From 210196437e3e756a4cf2460fee8eb52b81170751 Mon Sep 17 00:00:00 2001 From: wkc <978997012@qq.com> Date: Fri, 6 Feb 2026 12:35:38 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=BC=BA=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E6=9F=A5=E8=AF=A2=E7=9A=84=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加404错误处理(记录过期) - 添加500错误和500错误的友好提示 - 错误时自动清除localStorage并隐藏按钮 Co-Authored-By: Claude Sonnet 4.5 --- ruoyi-ui/src/views/ccdiEmployee/index.vue | 24 ++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/ruoyi-ui/src/views/ccdiEmployee/index.vue b/ruoyi-ui/src/views/ccdiEmployee/index.vue index 2a01d9a..1de8871 100644 --- a/ruoyi-ui/src/views/ccdiEmployee/index.vue +++ b/ruoyi-ui/src/views/ccdiEmployee/index.vue @@ -817,7 +817,29 @@ export default { this.failureLoading = false; }).catch(error => { this.failureLoading = false; - this.$modal.msgError('查询失败记录失败: ' + error.message); + + // 处理不同类型的错误 + if (error.response) { + const status = error.response.status; + + if (status === 404) { + // 记录不存在或已过期 + this.$modal.msgWarning('导入记录已过期,无法查看失败记录'); + this.clearImportTaskFromStorage(); + this.showFailureButton = false; + this.currentTaskId = null; + this.failureDialogVisible = false; + } else if (status === 500) { + this.$modal.msgError('服务器错误,请稍后重试'); + } else { + this.$modal.msgError(`查询失败: ${error.response.data.msg || '未知错误'}`); + } + } else if (error.request) { + // 请求发送了但没有收到响应 + this.$modal.msgError('网络连接失败,请检查网络'); + } else { + this.$modal.msgError('查询失败记录失败: ' + error.message); + } }); }, // 提交上传文件