Skip to content

Commit 462a5d4

Browse files
committed
修复重试
1 parent 14cc8bf commit 462a5d4

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "markdown-downloader",
3-
"version": "1.0.4",
3+
"version": "1.0.5",
44
"description": "markdown文章下载",
55
"main": "dist/index.js",
66
"scripts": {

src/download.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ export const ajax = (options) => {
3535
}
3636
}
3737
xhr.error = (err) => {
38-
if (retry--) {
39-
console.log(err)
40-
noop(options.error)(err, xhr)
41-
} else {
38+
if (retry) {
4239
setTimeout(() => {
4340
core(retry - 1)
4441
}, 3e3)
42+
} else {
43+
console.log(err)
44+
noop(options.error)(err, xhr)
4545
}
4646
}
4747
if (/post/i.test(options.method)) {

0 commit comments

Comments
 (0)