Update axios.js

main
wangqiujuan0808 2024-06-25 19:31:22 +08:00
parent 60261c9aac
commit 029ab94f06
1 changed files with 5 additions and 6 deletions

View File

@ -35,21 +35,20 @@ axios.interceptors.response.use(
}
}
}
if(res.config.headers['action'] == 53211) { //
if(!res.request || res.request.responseType === 'blob') { //
return res;
}
const ret = res.data;
// token
if (ret.code === 3004) {
if (res.data.code === 3004) {
localRemove("token");
ElMessage.closeAll();
ElMessage.error(ret.message || "Token异常,请重新登录");
ElMessage.error(res.data.message || "Token异常,请重新登录");
router.push({
path: "/login"
});
return Promise.reject(ret);
return Promise.reject(res.data);
}
return ret;
return Promise.resolve(res.data);
},
(error) => {
ElMessage.closeAll();