Explorar o código

修正hasRole匹配为equals

JuJu %!s(int64=5) %!d(string=hai) anos
pai
achega
8fdcd576c9

+ 1 - 1
ruoyi-common/ruoyi-common-security/src/main/java/com/ruoyi/common/security/aspect/PreAuthorizeAspect.java

@@ -168,7 +168,7 @@ public class PreAuthorizeAspect
168
         }
168
         }
169
         for (String roleKey : userInfo.getRoles())
169
         for (String roleKey : userInfo.getRoles())
170
         {
170
         {
171
-            if (SUPER_ADMIN.contains(roleKey) || roleKey.contains(role))
171
+            if (SUPER_ADMIN.equals(roleKey) || roleKey.equals(role))
172
             {
172
             {
173
                 return true;
173
                 return true;
174
             }
174
             }