|
@@ -151,8 +151,12 @@ export function hasRoles(roles: any, route: any) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
export function hasMenuPermission(permList: any, route: any) {
|
|
export function hasMenuPermission(permList: any, route: any) {
|
|
|
- if (route.meta && route.meta.perm) return permList.includes(route.meta.perm);
|
|
|
|
|
- else return true;
|
|
|
|
|
|
|
+ if (route.meta && route.meta.perm) {
|
|
|
|
|
+ const perms = String(route.meta.perm).split(',').map((p: string) => p.trim()).filter((p: string) => p.length > 0);
|
|
|
|
|
+ if (perms.length === 0) return true;
|
|
|
|
|
+ return perms.some((perm: string) => permList.includes(perm));
|
|
|
|
|
+ }
|
|
|
|
|
+ return true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|