优化系统提示,修改单点登陆bug

This commit is contained in:
王创世 2025-04-03 15:54:28 +08:00
parent e13fe892f8
commit 93e3eab6bf

View File

@ -45,20 +45,17 @@ class Http {
/* 响应拦截 */
this.service.interceptors.response.use((response: AxiosResponse<any>) => {
if (response.data.code == 99998) {
layer.msg('会话超时, 请重新登录!', { icon: 2 });
router.push('/login');
return;
}
switch (response.data.code) {
case 1:
return response.data;
case 500:
return response.data;
case 99998:
layer.confirm(
'会话超时, 请重新登录',
{ icon : 2, yes: function(){
router.push('/login');
layer.closeAll()
}});
return response.data;
default:
case 0:
return response.data;
}
}, error => {