Files
tms-erp-web/src
weicw-dshsa 088c9cace0 🐛 导入失败时显示后端业务提示,不再误报系统错误
问题(用户实测反馈):导入只有一个表头的空文件时,前端提示「系统错误」,
用户误以为系统崩溃;后端其实已返回明确文案(400 + 「导入数据不能为空」)。

根因(两处叠加):
1) axios 错误分支 reject(new Error(error)) 把原始错误包装掉,
   error.response 丢失、message 退化成 [object Object];
2) 导入接口统一用 responseType:'blob',非 2xx 的响应体也是 Blob,
   而 axios 错误分支不做解析,拿不到后端 msg。

修复:
- src/axios.js:错误分支直接 reject 原始 axios 错误,保留 response;
- src/utils/import-excel.js:新增 resolveErrorMessage,从错误响应的 Blob 中
  解析后端 JSON 取 msg;解析不到时兜底为中文提示(不再暴露
  「Request failed with status code xxx」这类英文技术文案)。

验证:vite build 通过;模拟真实响应体验证 400 + 空表场景,
提示由「系统错误」变为后端原文「未读取到数据行,请确认表头下方已填写内容」。
2026-09-26 11:50:49 +08:00
..
2026-09-21 11:14:51 +08:00
2026-09-08 17:50:34 +08:00
2026-09-16 23:43:12 +08:00
2026-08-01 01:23:13 +08:00
2026-07-20 11:26:51 +08:00
2026-09-20 13:17:05 +08:00
2026-09-16 06:30:30 +08:00
2026-09-21 11:14:51 +08:00
2026-09-16 06:30:30 +08:00
2026-07-08 18:00:33 +08:00
2026-07-08 18:00:33 +08:00
2026-09-16 06:30:30 +08:00
2026-09-16 06:30:30 +08:00
2026-07-08 18:00:33 +08:00
2026-09-16 06:30:30 +08:00