feat: 增加后端权限控制

This commit is contained in:
meilin.huang
2021-06-09 16:58:57 +08:00
parent 9074e7637e
commit 3ebc3ee14d
39 changed files with 4463 additions and 3913 deletions

View File

@@ -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;