关闭权限控制

This commit is contained in:
ajaxfan
2021-03-23 09:24:22 +08:00
parent 75fccf6deb
commit db0b77d748

View File

@ -15,24 +15,24 @@ import com.chinaunicom.mall.ebtp.cloud.security.starter.filter.TokenAuthenticati
* @author Ajaxfan * @author Ajaxfan
*/ */
@EnableWebSecurity @EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled = true, jsr250Enabled = true, securedEnabled = true) @EnableGlobalMethodSecurity(prePostEnabled = false, jsr250Enabled = true, securedEnabled = true)
public class BrowserSecurityConfig extends WebSecurityConfigurerAdapter { public class BrowserSecurityConfig extends WebSecurityConfigurerAdapter {
@Bean @Bean
public TokenAuthenticationFilter authenticationTokenFilterBean() { public TokenAuthenticationFilter authenticationTokenFilterBean() {
return new TokenAuthenticationFilter(); return new TokenAuthenticationFilter();
} }
/** /**
* 向Filter链中插入自定义TokenFilter * 向Filter链中插入自定义TokenFilter
* *
* @param http * @param http
* @throws Exception * @throws Exception
*/ */
@Override @Override
protected void configure(HttpSecurity http) throws Exception { protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable(); http.csrf().disable();
http.addFilterBefore(authenticationTokenFilterBean(), UsernamePasswordAuthenticationFilter.class); http.addFilterBefore(authenticationTokenFilterBean(), UsernamePasswordAuthenticationFilter.class);
} }
} }