增加版本管理页面,修改店铺添加地图组件使用
This commit is contained in:
@@ -74,15 +74,16 @@ function redirectToLogin(to: RouteLocationNormalized, next: NavigationGuardNext)
|
||||
|
||||
/** 判断是否有权限 */
|
||||
export function hasAuth(value: string | string[], type: "button" | "role" = "button") {
|
||||
const { roles, perms } = useUserStore().userInfo;
|
||||
|
||||
const { roles } = useUserStore().userInfo;
|
||||
const perms = useUserStore().promissionList;
|
||||
// 超级管理员 拥有所有权限
|
||||
if (type === "button" && roles.includes("ROOT")) {
|
||||
return true;
|
||||
}
|
||||
// if (type === "button" && roles.includes("ROOT")) {
|
||||
// return true;
|
||||
// }
|
||||
return true;
|
||||
|
||||
const auths = type === "button" ? perms : roles;
|
||||
return typeof value === "string"
|
||||
? auths.includes(value)
|
||||
: value.some((perm) => auths.includes(perm));
|
||||
// const auths = type === "button" ? perms : roles;
|
||||
// return typeof value === "string"
|
||||
// ? auths.includes(value)
|
||||
// : value.some((perm) => auths.includes(perm));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user