소스 검색

修正hasRole匹配为equals

JuJu 5 년 전
부모
커밋
8fdcd576c9
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      ruoyi-common/ruoyi-common-security/src/main/java/com/ruoyi/common/security/aspect/PreAuthorizeAspect.java

+ 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 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 173
                 return true;
174 174
             }