diff --git a/src/components/drawers/ExportScore.vue b/src/components/drawers/ExportScore.vue index c555a587..b3ee5147 100644 --- a/src/components/drawers/ExportScore.vue +++ b/src/components/drawers/ExportScore.vue @@ -236,6 +236,12 @@ export default { if (status === "done") { state.fileName = info.file.name; let i = 0; + let timeouts = setTimeout(() => { + clearInterval(timer) + state.addLoading = false; + message.destroy(); + message.error(`文件导入超时`); + }, 30000); let timer = setInterval(() => { let uid = info.file.response.data; api @@ -256,25 +262,21 @@ export default { state.downloadErrUrl = res.data.data.url; console.log("props.getStudent", props.getStudent); clearInterval(timer); + clearTimeout(timeouts); } } else { state.addLoading = false; message.destroy(); - message.error(`文件导入超时`); + clearTimeout(timeouts); } }) .catch((err) => { state.addLoading = false; clearInterval(timer); + clearTimeout(timeouts); console.log("查询导入状态失败", err); }); }, 500); - setTimeout(() => { - clearInterval(timer) - state.addLoading = false; - message.destroy(); - message.error(`文件导入超时`); - }, 30000); } else if (status === "error") { state.uploadErr = true; message.error(`${info.file.name}上传失败`); diff --git a/src/components/drawers/project/ProjectExternalExamManage.vue b/src/components/drawers/project/ProjectExternalExamManage.vue index 61f62857..49b7f074 100644 --- a/src/components/drawers/project/ProjectExternalExamManage.vue +++ b/src/components/drawers/project/ProjectExternalExamManage.vue @@ -296,7 +296,7 @@ customRender: (text) => { return (