fix(通用模块): 未登入访问对应模块url时,报错Network Error

This commit is contained in:
chenjianxing 2023-04-16 18:09:33 +08:00 committed by 刘瑞斌
parent 4fc707729a
commit 5f09ae7577
1 changed files with 3 additions and 0 deletions

View File

@ -3,6 +3,9 @@ import {getCurrentProjectID, getCurrentUser, getCurrentWorkspaceId} from "./toke
export function hasPermission(permission) {
let user = getCurrentUser();
if (!user || !user.groups) {
return false;
}
let index = user.groups.findIndex(g => g.id === SUPER_GROUP);
if (index !== -1) {
return true;