fix: 修复重复打开outputstream的问题
This commit is contained in:
parent
948f6fc9d2
commit
e247248652
backend/src/main/java/io/metersphere/config
|
@ -2,7 +2,6 @@ package io.metersphere.config;
|
||||||
|
|
||||||
import io.metersphere.commons.utils.ShiroUtils;
|
import io.metersphere.commons.utils.ShiroUtils;
|
||||||
import io.metersphere.security.ApiKeyFilter;
|
import io.metersphere.security.ApiKeyFilter;
|
||||||
import io.metersphere.security.LoginFilter;
|
|
||||||
import io.metersphere.security.ShiroDBRealm;
|
import io.metersphere.security.ShiroDBRealm;
|
||||||
import org.apache.shiro.cache.MemoryConstrainedCacheManager;
|
import org.apache.shiro.cache.MemoryConstrainedCacheManager;
|
||||||
import org.apache.shiro.session.mgt.SessionManager;
|
import org.apache.shiro.session.mgt.SessionManager;
|
||||||
|
@ -36,7 +35,7 @@ public class ShiroConfig implements EnvironmentAware {
|
||||||
@Bean
|
@Bean
|
||||||
public ShiroFilterFactoryBean getShiroFilterFactoryBean(DefaultWebSecurityManager sessionManager) {
|
public ShiroFilterFactoryBean getShiroFilterFactoryBean(DefaultWebSecurityManager sessionManager) {
|
||||||
ShiroFilterFactoryBean shiroFilterFactoryBean = new ShiroFilterFactoryBean();
|
ShiroFilterFactoryBean shiroFilterFactoryBean = new ShiroFilterFactoryBean();
|
||||||
shiroFilterFactoryBean.getFilters().put("authc", new LoginFilter());
|
// shiroFilterFactoryBean.getFilters().put("authc", new LoginFilter());
|
||||||
shiroFilterFactoryBean.setLoginUrl("/login");
|
shiroFilterFactoryBean.setLoginUrl("/login");
|
||||||
shiroFilterFactoryBean.setSecurityManager(sessionManager);
|
shiroFilterFactoryBean.setSecurityManager(sessionManager);
|
||||||
shiroFilterFactoryBean.setUnauthorizedUrl("/403");
|
shiroFilterFactoryBean.setUnauthorizedUrl("/403");
|
||||||
|
@ -45,7 +44,8 @@ public class ShiroConfig implements EnvironmentAware {
|
||||||
shiroFilterFactoryBean.getFilters().put("apikey", new ApiKeyFilter());
|
shiroFilterFactoryBean.getFilters().put("apikey", new ApiKeyFilter());
|
||||||
Map<String, String> filterChainDefinitionMap = shiroFilterFactoryBean.getFilterChainDefinitionMap();
|
Map<String, String> filterChainDefinitionMap = shiroFilterFactoryBean.getFilterChainDefinitionMap();
|
||||||
ShiroUtils.loadBaseFilterChain(filterChainDefinitionMap);
|
ShiroUtils.loadBaseFilterChain(filterChainDefinitionMap);
|
||||||
filterChainDefinitionMap.put("/**", "apikey, authc");
|
// filterChainDefinitionMap.put("/**", "apikey, authc");
|
||||||
|
filterChainDefinitionMap.put("/**", "apikey");
|
||||||
return shiroFilterFactoryBean;
|
return shiroFilterFactoryBean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue