Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Fedex
/
EcomWeb
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
zhanbo.xu
2026-02-07 16:28:10 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f421ff79959d11b22a6903353a6cb53c5df7b227
f421ff79
1 parent
317a9a72
feat: 优化导出配置10103的情况
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
24 deletions
src/views/exportListQuery/index.vue
src/views/exportListQuery/index.vue
View file @
f421ff7
...
...
@@ -428,7 +428,6 @@ export default {
pollInterval: 5000, // 轮询间隔(5秒)
isPolling: false, // 轮询状态标识
currentTaskId: null,
maxPollCount: 0,
pollCount: 0,
};
},
...
...
@@ -516,7 +515,7 @@ export default {
};
},
downLoadZip() {
downLoadZip(
retryCount = 0
) {
const baseUrl = process.env.VUE_APP_BASE_API;
console.log(this.currentTaskId);
axios({
...
...
@@ -550,7 +549,17 @@ export default {
debugger;
let jsonData = JSON.parse(reader.result);
if (jsonData.code == "10103") {
this.startPolling(50);
// 检查重试次数
if (retryCount < 50) {
// 延迟后重试
setTimeout(() => {
this.downLoadZip(retryCount + 1);
}, 5000); // 5秒后重试
} else {
this.alertWarningMsg("导出失败");
this.exportLoading = false;
}
return;
}
this.alertWarningMsg(jsonData.message);
...
...
@@ -608,7 +617,7 @@ export default {
this.handleFailure();
this.alertWarningMsg(result.data.errorMessage);
} else {
this.startPolling(
0
); // 启动轮询
this.startPolling(); // 启动轮询
}
} else {
this.stopPolling();
...
...
@@ -621,29 +630,11 @@ export default {
}
},
// 启动轮询
startPolling(maxPollCount) {
// if (this.isPolling) return;
// this.isPolling = true;
// this.pollTimer = setInterval(() => {
// this.pollStatus();
// }, this.pollInterval);
startPolling() {
if (this.isPolling) return;
this.isPolling = true;
this.pollCount = 0; // 初始化轮询计数器
this.maxPollCount = maxPollCount; // 设置最大轮询次数
this.pollTimer = setInterval(() => {
this.pollCount++; // 每次轮询增加计数
// 检查是否达到最大轮询次数
if (this.pollCount > this.maxPollCount && this.maxPollCount !== 0) {
this.stopPolling();
this.alertWarningMsg("导出失败!");
return;
}
this.pollStatus();
}, this.pollInterval);
},
...
...
@@ -699,7 +690,7 @@ export default {
if (+res.code === 200) {
console.log(res);
this.currentTaskId = res.data;
this.startPolling(
0
);
this.startPolling();
}
});
// this.fileDownload
...
...
Please
register
or
login
to post a comment