chore: 脚手架
This commit is contained in:
@@ -24,6 +24,12 @@ async function generateAccessible(
|
||||
|
||||
// 动态添加到router实例内
|
||||
accessibleRoutes.forEach((route) => {
|
||||
/**
|
||||
* 外链不应该被添加到路由 由menu处理
|
||||
*/
|
||||
if (/^http(s)?:\/\//.test(route.path)) {
|
||||
return;
|
||||
}
|
||||
router.addRoute(route);
|
||||
});
|
||||
|
||||
|
@@ -28,7 +28,13 @@ function useAccess() {
|
||||
*/
|
||||
function hasAccessByCodes(codes: string[]) {
|
||||
const userCodesSet = new Set(accessStore.accessCodes);
|
||||
|
||||
/**
|
||||
* 管理员权限
|
||||
*/
|
||||
if (userCodesSet.has('*:*:*')) {
|
||||
return true;
|
||||
}
|
||||
// 其他 判断是否存在
|
||||
const intersection = codes.filter((item) => userCodesSet.has(item));
|
||||
return intersection.length > 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user