提交 dd2ecab7 编写于 作者: zhouweidong's avatar zhouweidong

修复业务系统多浏览访问bug

上级 3a66f742
...@@ -3,6 +3,7 @@ package cn.ibizlab.api.config; ...@@ -3,6 +3,7 @@ package cn.ibizlab.api.config;
import cn.ibizlab.util.security.AuthenticationEntryPoint; import cn.ibizlab.util.security.AuthenticationEntryPoint;
import cn.ibizlab.util.security.AuthorizationTokenFilter; import cn.ibizlab.util.security.AuthorizationTokenFilter;
import cn.ibizlab.util.service.AuthenticationUserService; import cn.ibizlab.util.service.AuthenticationUserService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
...@@ -55,6 +56,9 @@ public class apiSecurityConfig extends WebSecurityConfigurerAdapter { ...@@ -55,6 +56,9 @@ public class apiSecurityConfig extends WebSecurityConfigurerAdapter {
@Value("${ibiz.file.previewpath:ibizutil/preview}") @Value("${ibiz.file.previewpath:ibizutil/preview}")
private String previewpath; private String previewpath;
@Value("${ibiz.auth.excludesPattern:}")
private String excludesPattern;
@Autowired @Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception { public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
auth auth
...@@ -123,9 +127,17 @@ public class apiSecurityConfig extends WebSecurityConfigurerAdapter { ...@@ -123,9 +127,17 @@ public class apiSecurityConfig extends WebSecurityConfigurerAdapter {
.antMatchers("/ibzemployees/**/oumaps").permitAll() .antMatchers("/ibzemployees/**/oumaps").permitAll()
.antMatchers("/ibzorganizations/**/suborg/picker").permitAll() .antMatchers("/ibzorganizations/**/suborg/picker").permitAll()
.antMatchers("/dictionarys/**").permitAll() .antMatchers("/dictionarys/**").permitAll()
.antMatchers("/sysemployees/**/oumaps").permitAll() .antMatchers("/sysemployees/**/oumaps").permitAll();
// 所有请求都需要认证
if (StringUtils.isNotBlank(excludesPattern)) {
for (String excludePattern : excludesPattern.split("\\s*,\\s*")) {
authenticationTokenFilter.addExcludePattern(excludePattern);
httpSecurity.authorizeRequests().antMatchers(excludePattern).permitAll();
}
}
// 所有请求都需要认证 // 所有请求都需要认证
.anyRequest().authenticated() httpSecurity.authorizeRequests().anyRequest().authenticated()
// 防止iframe 造成跨域 // 防止iframe 造成跨域
.and().headers().frameOptions().disable(); .and().headers().frameOptions().disable();
......
...@@ -92,6 +92,8 @@ ribbon: ...@@ -92,6 +92,8 @@ ribbon:
ibiz: ibiz:
enablePermissionValid: true enablePermissionValid: true
cacheLevel: L1 #(L1)一级本地caffeine缓存;(L2)caffeine缓存+Redis缓存 cacheLevel: L1 #(L1)一级本地caffeine缓存;(L2)caffeine缓存+Redis缓存
auth:
excludesPattern: /sysemployees/**/oumaps
### jobs ### jobs
jobs: jobs:
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册