fix: 修复重复打开outputstream的问题

This commit is contained in:
Captain.B 2020-09-29 13:45:45 +08:00
parent 948f6fc9d2
commit e247248652
1 changed files with 3 additions and 3 deletions

View File

@ -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<String, String> filterChainDefinitionMap = shiroFilterFactoryBean.getFilterChainDefinitionMap();
ShiroUtils.loadBaseFilterChain(filterChainDefinitionMap);
filterChainDefinitionMap.put("/**", "apikey, authc");
// filterChainDefinitionMap.put("/**", "apikey, authc");
filterChainDefinitionMap.put("/**", "apikey");
return shiroFilterFactoryBean;
}