签入版本
This commit is contained in:
@@ -45,11 +45,11 @@ if (code === 401 || res.status === 401) {
|
||||
|
||||
if (code === 403 || res.status === 403) {
|
||||
// 权限不足 / 租户异常 / 演示模式拦截
|
||||
ElMessage.error(msg || '无访问权限');
|
||||
message.error(msg || '无访问权限');
|
||||
}
|
||||
|
||||
// 其他业务错误,显示提示
|
||||
ElMessage.error(msg || '操作失败');
|
||||
message.error(msg || '操作失败');
|
||||
```
|
||||
|
||||
:::tip 响应处理规则
|
||||
@@ -66,12 +66,17 @@ ElMessage.error(msg || '操作失败');
|
||||
// code === 401(ResultEnum.TIMEOUT)
|
||||
case ResultEnum.TIMEOUT:
|
||||
if (router.currentRoute.value?.name === PageEnum.BASE_LOGIN_NAME) return;
|
||||
ElMessageBox.confirm('登录身份已失效,请重新登录!', '提示', { type: 'warning' })
|
||||
.then(() => {
|
||||
Modal.warning({
|
||||
title: '提示',
|
||||
content: '登录身份已失效,请重新登录!',
|
||||
closable: false,
|
||||
maskClosable: false,
|
||||
okText: '确定',
|
||||
onOk: () => {
|
||||
storage.clear();
|
||||
window.location.href = PageEnum.BASE_LOGIN; // '/login'
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
});
|
||||
break;
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user