From e2472486527e3e12be3233595bf39be92c1c0a41 Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Tue, 29 Sep 2020 13:45:45 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E6=89=93=E5=BC=80outputstream=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/io/metersphere/config/ShiroConfig.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/src/main/java/io/metersphere/config/ShiroConfig.java b/backend/src/main/java/io/metersphere/config/ShiroConfig.java index 87e63496fa..4a3b00c4a9 100644 --- a/backend/src/main/java/io/metersphere/config/ShiroConfig.java +++ b/backend/src/main/java/io/metersphere/config/ShiroConfig.java @@ -2,7 +2,6 @@ package io.metersphere.config; import io.metersphere.commons.utils.ShiroUtils; import io.metersphere.security.ApiKeyFilter; -import io.metersphere.security.LoginFilter; import io.metersphere.security.ShiroDBRealm; import org.apache.shiro.cache.MemoryConstrainedCacheManager; import org.apache.shiro.session.mgt.SessionManager; @@ -36,7 +35,7 @@ public class ShiroConfig implements EnvironmentAware { @Bean public ShiroFilterFactoryBean getShiroFilterFactoryBean(DefaultWebSecurityManager sessionManager) { ShiroFilterFactoryBean shiroFilterFactoryBean = new ShiroFilterFactoryBean(); - shiroFilterFactoryBean.getFilters().put("authc", new LoginFilter()); +// shiroFilterFactoryBean.getFilters().put("authc", new LoginFilter()); shiroFilterFactoryBean.setLoginUrl("/login"); shiroFilterFactoryBean.setSecurityManager(sessionManager); shiroFilterFactoryBean.setUnauthorizedUrl("/403"); @@ -45,7 +44,8 @@ public class ShiroConfig implements EnvironmentAware { shiroFilterFactoryBean.getFilters().put("apikey", new ApiKeyFilter()); Map filterChainDefinitionMap = shiroFilterFactoryBean.getFilterChainDefinitionMap(); ShiroUtils.loadBaseFilterChain(filterChainDefinitionMap); - filterChainDefinitionMap.put("/**", "apikey, authc"); +// filterChainDefinitionMap.put("/**", "apikey, authc"); + filterChainDefinitionMap.put("/**", "apikey"); return shiroFilterFactoryBean; }