From 3c4b01ab839d9bfc87cd40828a49d5cc5ae4b153 Mon Sep 17 00:00:00 2001 From: DokiYoloo <857815116@qq.com> Date: Mon, 21 Dec 2020 19:43:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9D=83=E9=99=90=E5=B7=A5=E5=85=B7=E7=B1=BB?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0admin=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/utils/permission.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ruoyi-ui/src/utils/permission.js b/ruoyi-ui/src/utils/permission.js index 784e379d..25d1a029 100644 --- a/ruoyi-ui/src/utils/permission.js +++ b/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) {