From bd451f9fc0572b0d789af35d5931a23a7162d9e4 Mon Sep 17 00:00:00 2001 From: yaojn Date: Wed, 14 May 2025 16:49:13 +0800 Subject: [PATCH] =?UTF-8?q?-=20[=E4=BF=AE=E5=A4=8D]=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=8E=88=E6=9D=83=E9=A1=B5=E9=9D=A2=EF=BC=8C=E7=BB=A7=E6=89=BF?= =?UTF-8?q?=E8=A7=92=E8=89=B2=E7=9A=84=E6=9D=83=E9=99=90=E5=9B=9E=E6=98=BE?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=EF=BC=8C=E6=9D=83=E9=99=90=E8=8C=83=E5=9B=B4?= =?UTF-8?q?=E6=89=A9=E5=A4=A7=E4=BA=86=20=20=20=20-=20[=E5=85=B3=E8=81=94]?= =?UTF-8?q?#[1421064012267520]=E7=94=A8=E6=88=B7=E6=8E=88=E6=9D=83?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=EF=BC=8C=E7=BB=A7=E6=89=BF=E8=A7=92=E8=89=B2?= =?UTF-8?q?=E7=9A=84=E6=9D=83=E9=99=90=E5=9B=9E=E6=98=BE=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=EF=BC=8C=E6=9D=83=E9=99=90=E8=8C=83=E5=9B=B4=E6=89=A9=E5=A4=A7?= =?UTF-8?q?=E4=BA=86=20http://192.168.0.96:8090/demo/rdm.html#/bug-detail/?= =?UTF-8?q?939050947543040/939050947543057/1421064012267520?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/framework/users/common/common-auth.vue | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/views/pages/framework/users/common/common-auth.vue b/src/views/pages/framework/users/common/common-auth.vue index 84271a771..67f5247b1 100644 --- a/src/views/pages/framework/users/common/common-auth.vue +++ b/src/views/pages/framework/users/common/common-auth.vue @@ -89,9 +89,19 @@ export default { isDisabled(row) { // 继承角色权限,不允许取消授权 let isDisabled = false; - let authRoleObj = JSON.stringify(this.authRoleSelectList); - let hasAuthRole = authRoleObj.indexOf(row.name); - isDisabled = hasAuthRole != '-1'; + const {name = ''} = row || {}; + if (this.$utils.isEmpty(name)) { + return false; + } + // 处理继承角色权限,之前是转成JSON字符串去匹配,导致匹配的权限不对,授权范围扩大了。 + for (let key in this.authRoleSelectList) { + if (key && this.authRoleSelectList[key] && this.authRoleSelectList[key].length > 0 && Array.isArray(this.authRoleSelectList[key])) { + if (this.authRoleSelectList[key].some(authName => authName === row.name)) { + isDisabled = true; + break; + } + } + } return isDisabled; }, isReadOnly() { -- Gitee