Просмотр исходного кода

修改权限字符匹配方式

RuoYi лет назад: 2
Родитель
Сommit
2eaabefeac

+ 2 - 2
ruoyi-common/ruoyi-common-security/src/main/java/com/ruoyi/common/security/auth/AuthLogic.java

@@ -355,7 +355,7 @@ public class AuthLogic
355
     public boolean hasPermi(Collection<String> authorities, String permission)
355
     public boolean hasPermi(Collection<String> authorities, String permission)
356
     {
356
     {
357
         return authorities.stream().filter(StringUtils::hasText)
357
         return authorities.stream().filter(StringUtils::hasText)
358
-                .anyMatch(x -> ALL_PERMISSION.contains(x) || PatternMatchUtils.simpleMatch(x, permission));
358
+                .anyMatch(x -> ALL_PERMISSION.equals(x) || PatternMatchUtils.simpleMatch(x, permission));
359
     }
359
     }
360
 
360
 
361
     /**
361
     /**
@@ -368,6 +368,6 @@ public class AuthLogic
368
     public boolean hasRole(Collection<String> roles, String role)
368
     public boolean hasRole(Collection<String> roles, String role)
369
     {
369
     {
370
         return roles.stream().filter(StringUtils::hasText)
370
         return roles.stream().filter(StringUtils::hasText)
371
-                .anyMatch(x -> SUPER_ADMIN.contains(x) || PatternMatchUtils.simpleMatch(x, role));
371
+                .anyMatch(x -> SUPER_ADMIN.equals(x) || PatternMatchUtils.simpleMatch(x, role));
372
     }
372
     }
373
 }
373
 }

+ 1 - 1
ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/ValidateCodeFilter.java

@@ -45,7 +45,7 @@ public class ValidateCodeFilter extends AbstractGatewayFilterFactory<Object>
45
             ServerHttpRequest request = exchange.getRequest();
45
             ServerHttpRequest request = exchange.getRequest();
46
 
46
 
47
             // 非登录/注册请求或验证码关闭,不处理
47
             // 非登录/注册请求或验证码关闭,不处理
48
-            if (!StringUtils.containsAnyIgnoreCase(request.getURI().getPath(), VALIDATE_URL) || !captchaProperties.getEnabled())
48
+            if (!StringUtils.equalsAnyIgnoreCase(request.getURI().getPath(), VALIDATE_URL) || !captchaProperties.getEnabled())
49
             {
49
             {
50
                 return chain.filter(exchange);
50
                 return chain.filter(exchange);
51
             }
51
             }