提交 969fc671 authored 作者: 王鹏飞's avatar 王鹏飞

bug fixes

上级 7537705e
......@@ -49,14 +49,7 @@ httpRequest.interceptors.request.use(
httpRequest.interceptors.response.use(
function (response) {
const { data } = response
// 正常返回
if (data.code === 0 || data.type === 'application/vnd.ms-excel') {
return data
}
// 批阅试卷接口
if (data.success && data.message === 'ok') {
return data
}
if (data.code) {
// 未登录
if (data.code === 4001) {
window.location.href = `${import.meta.env.VITE_LOGIN_URL}?rd=${encodeURIComponent(window.location.href)}`
......@@ -70,9 +63,10 @@ httpRequest.interceptors.response.use(
Message({ message: '没有操作权限', type: 'error' })
return data
}
console.log(data)
Message({ message: data.message, type: 'error' })
return Promise.reject(data)
}
return data
},
function (error) {
if (error.response) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论