فهرست منبع

权限工具类增加admin判断

DokiYoloo 4 سال پیش
والد
کامیت
3c4b01ab83
1فایلهای تغییر یافته به همراه4 افزوده شده و 2 حذف شده
  1. 4 2
      ruoyi-ui/src/utils/permission.js

+ 4 - 2
ruoyi-ui/src/utils/permission.js

@@ -9,9 +9,10 @@ export function checkPermi(value) {
   if (value && value instanceof Array && value.length > 0) {
     const permissions = store.getters && store.getters.permissions
     const permissionDatas = value
+    const all_permission = "*:*:*";
 
     const hasPermission = permissions.some(permission => {
-      return permissionDatas.includes(permission)
+      return all_permission === permission || permissionDatas.includes(permission)
     })
 
     if (!hasPermission) {
@@ -33,9 +34,10 @@ export function checkRole(value) {
   if (value && value instanceof Array && value.length > 0) {
     const roles = store.getters && store.getters.roles
     const permissionRoles = value
+    const super_admin = "admin";
 
     const hasRole = roles.some(role => {
-      return permissionRoles.includes(role)
+      return super_admin === role || permissionRoles.includes(role)
     })
 
     if (!hasRole) {