Skip to content

Commit

Permalink
修复重试
Browse files Browse the repository at this point in the history
  • Loading branch information
kscript committed Oct 24, 2023
1 parent 14cc8bf commit 19be344
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "markdown-downloader",
"version": "1.0.4",
"version": "1.0.5",
"description": "markdown文章下载",
"main": "dist/index.js",
"scripts": {
Expand Down
6 changes: 3 additions & 3 deletions src/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ export const ajax = (options) => {
}
xhr.error = (err) => {
if (retry--) {
console.log(err)
noop(options.error)(err, xhr)
} else {
setTimeout(() => {
core(retry - 1)
}, 3e3)
} else {
console.log(err)
noop(options.error)(err, xhr)
}
}
if (/post/i.test(options.method)) {
Expand Down

0 comments on commit 19be344

Please sign in to comment.