diff --git a/rc-gateway/src/main/java/com/red/circle/gateway/filter/AuthGlobalFilter.java b/rc-gateway/src/main/java/com/red/circle/gateway/filter/AuthGlobalFilter.java index 2b97095d..4d9cfc2c 100644 --- a/rc-gateway/src/main/java/com/red/circle/gateway/filter/AuthGlobalFilter.java +++ b/rc-gateway/src/main/java/com/red/circle/gateway/filter/AuthGlobalFilter.java @@ -50,6 +50,10 @@ import reactor.core.publisher.Mono; @RequiredArgsConstructor public class AuthGlobalFilter implements GlobalFilter, Ordered { + private static final List FORCE_IGNORE_PATHS = List.of( + "/console/datav/aslan/integrated-statistics" + ); + private final ObjectMapper objectMapper; private final GatewayProperties gatewayProperties; private final AuthEndpointService authEndpointService; @@ -211,9 +215,16 @@ public class AuthGlobalFilter implements GlobalFilter, Ordered { private boolean isIgnoreMatcherPath(ServerWebExchange exchange) { String url = exchange.getRequest().getURI().getRawPath(); log.debug(url); + if (matchIgnorePath(FORCE_IGNORE_PATHS, url)) { + return true; + } List ignorePaths = gatewayProperties.getIgnorePaths(); log.debug(ignorePaths.toString()); - for (String ignoreUrl : ignorePaths) { + return matchIgnorePath(ignorePaths, url); + } + + private boolean matchIgnorePath(List ignorePaths, String url) { + for (String ignoreUrl : Optional.ofNullable(ignorePaths).orElse(List.of())) { if (pathMatcher.match(ignoreUrl, url)) { log.debug("true : {}{}",url, ignoreUrl); return true;