|
@@ -50,10 +50,9 @@ axios.interceptors.response.use(res => {
|
|
res.config.metadata.endTime = new Date()
|
|
res.config.metadata.endTime = new Date()
|
|
//获取状态码
|
|
//获取状态码
|
|
const status = res.data?.code || res.status;
|
|
const status = res.data?.code || res.status;
|
|
- const message = res.data?.msg || res.data['error_description'] || '未知错误';
|
|
|
|
//如果是401则跳转到登录页面
|
|
//如果是401则跳转到登录页面
|
|
if (status === 401) {
|
|
if (status === 401) {
|
|
- window.$message?.error(message || '身份失效!');
|
|
|
|
|
|
+ window.$message?.error('身份失效,请重新登录!');
|
|
router.push({path: '/login'})
|
|
router.push({path: '/login'})
|
|
}
|
|
}
|
|
// 如果请求为非200, 自行catch逻辑处理
|
|
// 如果请求为非200, 自行catch逻辑处理
|