mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-12-14 19:56:35 +08:00
feat: 增加后端权限控制
This commit is contained in:
@@ -62,14 +62,9 @@ service.interceptors.response.use(
|
||||
const data: Result = response.data;
|
||||
// 如果提示没有权限,则移除token,使其重新登录
|
||||
if (data.code === ResultEnum.NO_PERMISSION) {
|
||||
removeSession('token')
|
||||
notifyErrorMsg('登录超时')
|
||||
setTimeout(() => {
|
||||
router.push({
|
||||
path: '/login',
|
||||
});
|
||||
}, 1000)
|
||||
return;
|
||||
router.push({
|
||||
path: '/401',
|
||||
});
|
||||
}
|
||||
if (data.code === ResultEnum.SUCCESS) {
|
||||
return data.data;
|
||||
|
||||
Reference in New Issue
Block a user