Skip to content

Conversation

@axibayuit-a11y
Copy link
Contributor

原因分析

原代码只捕获有 response 属性的错误:

.catch(err => {
    if (err.response && err.response.status !== 401) {
        this.exceptionList.push(file)
    }
})
网络错误没有 response 属性,不会被加入 exceptionList,导致自动重试机制无法触发。

修改内容
捕获网络错误:添加 else if (!err.response) 判断,将网络错误也加入异常列表
优化并发控制:使用精确计数 activeUploads 替代状态计数 uploadingCount,避免 Vue 响应式延迟导致的计数不准确
测试结果
上传 400 张图片,遇到多次 ERR_CONNECTION_RESET / ERR_CONNECTION_CLOSED,全部自动重试成功。

@MarSeventh MarSeventh changed the base branch from master to dev December 31, 2025 06:25
@MarSeventh MarSeventh merged commit 1540035 into MarSeventh:dev Dec 31, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants