在线编辑

This commit is contained in:
weibl
2026-02-25 11:31:47 +08:00
parent b519f5e42f
commit f98a711789
4 changed files with 28 additions and 13 deletions

View File

@@ -41,12 +41,16 @@ service.interceptors.request.use(
service.interceptors.response.use(
(res) => {
// 判断响应类型,如果是 blob,返回完整响应对象
// 判断响应类型,如果是 文件流,返回完整响应对象
if (res.headers['content-type'].includes('octet-stream')) {
return res;
}
if (res.config.responseType === 'blob') {
// 判断响应类型,如果是 blob返回完整响应对象
return res;
}
// 普通接口返回原来的 res.data
if (res.data.code !== 200) {
if (res.data?.code && res.data?.code !== 200) {
ElMessage.warning(res.data.message);
}
return res.data;