From 99b4713134ced23f239d18191edde08ad56bc491 Mon Sep 17 00:00:00 2001 From: CaptainB Date: Fri, 3 Feb 2023 21:15:26 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E4=BF=AE=E6=94=B9=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E7=B1=BB=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/metersphere/gateway/filter/LoginFilter.java | 4 ++-- .../main/java/io/metersphere/autoconfigure/ShiroConfig.java | 6 +++--- .../utils/{ShiroUtils.java => FilterChainUtils.java} | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) rename framework/sdk-parent/sdk/src/main/java/io/metersphere/commons/utils/{ShiroUtils.java => FilterChainUtils.java} (99%) diff --git a/framework/gateway/src/main/java/io/metersphere/gateway/filter/LoginFilter.java b/framework/gateway/src/main/java/io/metersphere/gateway/filter/LoginFilter.java index 9a98b79244..b2eb38a76e 100644 --- a/framework/gateway/src/main/java/io/metersphere/gateway/filter/LoginFilter.java +++ b/framework/gateway/src/main/java/io/metersphere/gateway/filter/LoginFilter.java @@ -1,6 +1,6 @@ package io.metersphere.gateway.filter; -import io.metersphere.commons.utils.ShiroUtils; +import io.metersphere.commons.utils.FilterChainUtils; import jakarta.annotation.PostConstruct; import jakarta.annotation.Resource; import org.springdoc.core.properties.SwaggerUiConfigProperties; @@ -38,7 +38,7 @@ public class LoginFilter implements WebFilter, Ordered { // 各模块首页 swaggerUiConfigProperties.getUrls().forEach(v -> excludePatterns.add(new PathPatternParser().parse("/" + v.getName()))); - ShiroUtils.loadBaseFilterChain() + FilterChainUtils.loadBaseFilterChain() .forEach((url, v) -> { excludePatterns.add(new PathPatternParser().parse(url)); excludePatterns.add(new PathPatternParser().parse("/*" + url)); diff --git a/framework/sdk-parent/sdk/src/main/java/io/metersphere/autoconfigure/ShiroConfig.java b/framework/sdk-parent/sdk/src/main/java/io/metersphere/autoconfigure/ShiroConfig.java index c663613af4..8cc67756ed 100644 --- a/framework/sdk-parent/sdk/src/main/java/io/metersphere/autoconfigure/ShiroConfig.java +++ b/framework/sdk-parent/sdk/src/main/java/io/metersphere/autoconfigure/ShiroConfig.java @@ -1,7 +1,7 @@ package io.metersphere.autoconfigure; -import io.metersphere.commons.utils.ShiroUtils; +import io.metersphere.commons.utils.FilterChainUtils; import io.metersphere.security.ApiKeyFilter; import io.metersphere.security.CsrfFilter; import io.metersphere.security.MsPermissionAnnotationMethodInterceptor; @@ -43,9 +43,9 @@ public class ShiroConfig { shiroFilterFactoryBean.getFilters().put("csrf", new CsrfFilter()); Map filterChainDefinitionMap = shiroFilterFactoryBean.getFilterChainDefinitionMap(); - filterChainDefinitionMap.putAll(ShiroUtils.loadBaseFilterChain()); + filterChainDefinitionMap.putAll(FilterChainUtils.loadBaseFilterChain()); - filterChainDefinitionMap.putAll(ShiroUtils.ignoreCsrfFilter()); + filterChainDefinitionMap.putAll(FilterChainUtils.ignoreCsrfFilter()); filterChainDefinitionMap.put("/**", "apikey, csrf, authc"); return shiroFilterFactoryBean; diff --git a/framework/sdk-parent/sdk/src/main/java/io/metersphere/commons/utils/ShiroUtils.java b/framework/sdk-parent/sdk/src/main/java/io/metersphere/commons/utils/FilterChainUtils.java similarity index 99% rename from framework/sdk-parent/sdk/src/main/java/io/metersphere/commons/utils/ShiroUtils.java rename to framework/sdk-parent/sdk/src/main/java/io/metersphere/commons/utils/FilterChainUtils.java index 9ecb4117a2..c2e8fd58a2 100644 --- a/framework/sdk-parent/sdk/src/main/java/io/metersphere/commons/utils/ShiroUtils.java +++ b/framework/sdk-parent/sdk/src/main/java/io/metersphere/commons/utils/FilterChainUtils.java @@ -3,7 +3,7 @@ package io.metersphere.commons.utils; import java.util.HashMap; import java.util.Map; -public class ShiroUtils { +public class FilterChainUtils { public static Map loadBaseFilterChain() { Map filterChainDefinitionMap = new HashMap<>();