fix: 修复重复打开outputstream的问题
This commit is contained in:
parent
948f6fc9d2
commit
e247248652
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue