🎨优化如果一个页面退出了,其他都退出
All checks were successful
continuous-integration/drone/tag Build is passing

This commit is contained in:
coward 2024-06-07 17:09:21 +08:00
parent 92f5f26ad5
commit d1bb49c208

View File

@ -135,6 +135,14 @@ class PureHttp {
$error.isCancelRequest = Axios.isCancel($error); $error.isCancelRequest = Axios.isCancel($error);
// 关闭进度条动画 // 关闭进度条动画
NProgress.done(); NProgress.done();
if ($error.response.status === 401) {
router.replace({
path: "/login",
query: {
redirect: router.currentRoute.value.fullPath
}
});
}
// 所有的响应异常 区分来源为取消请求/非取消请求 // 所有的响应异常 区分来源为取消请求/非取消请求
return Promise.reject($error); return Promise.reject($error);
} }