From 78276faf271db4d7064eef29f1d1c25a71459d17 Mon Sep 17 00:00:00 2001 From: dftre <3066417822@qq.com> Date: Sat, 26 Oct 2024 19:53:12 +0800 Subject: [PATCH] =?UTF-8?q?!!=E9=87=8D=E8=A6=81=E8=A1=A5=E4=B8=81=201.=20?= =?UTF-8?q?=E5=9B=A0=E4=B8=BA=E7=BC=BA=E5=B0=91=E4=B8=80=E4=B8=AA=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E5=AF=BC=E8=87=B4loginUser.user.roles.get(=3F).getPer?= =?UTF-8?q?missions=20=E4=B8=BAnull=202.=20RuoYi=E7=9A=84dataScopeFilter?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E7=BC=BA=E5=B0=91=E5=A4=84=E7=90=86permissio?= =?UTF-8?q?n=E4=B8=BA=E7=A9=BA=E7=9A=84=E6=83=85=E5=86=B5=EF=BC=8C?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E5=8D=B3=E4=BE=BF=E7=AC=AC1=E6=9D=A1?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=8C=E4=BB=8D=E7=84=B6=E4=BC=9A=E5=9C=A8?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E9=89=B4=E6=9D=83=E7=9A=84=E6=83=85=E5=86=B5?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=9D=83=E9=99=90=E4=B8=8D=E6=AD=A3=E7=A1=AE?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/framework/web/service/SysPermissionService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysPermissionService.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysPermissionService.java index d453d6a..08e2381 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysPermissionService.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysPermissionService.java @@ -6,6 +6,7 @@ import java.util.Set; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import org.springframework.util.CollectionUtils; import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.core.domain.entity.SysRole; @@ -57,7 +58,7 @@ public class SysPermissionService { perms.add("*:*:*"); } else { List roles = user.getRoles(); - if (!roles.isEmpty() && roles.size() > 1) { + if (!CollectionUtils.isEmpty(roles)) { // 多角色设置permissions属性,以便数据权限匹配权限 for (SysRole role : roles) { if (StringUtils.equals(role.getStatus(), UserConstants.ROLE_NORMAL)) {