fix: 修改sercurity的放行策略

This commit is contained in:
weihongyang 2022-06-21 14:34:34 +08:00
parent 8e06463f12
commit b98c015abc

View File

@ -48,10 +48,11 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
.and() .and()
.authorizeRequests() .authorizeRequests()
// 对于登录接口 允许匿名访问 // 对于登录接口 允许匿名访问
.antMatchers("/login","/swagger/**","/v2/api-docs", .antMatchers("/login","/swagger/**","/v2/**",
"/doc.html", "/doc.html",
"/swagger-resources/**", "/swagger-resources/**",
"/swagger-ui/**").anonymous() "/swagger-ui/**",
"/webjars/**").anonymous()
// .antMatchers("/testCors").hasAuthority("system:dept:list222") // .antMatchers("/testCors").hasAuthority("system:dept:list222")
// 除上面外的所有请求全部需要鉴权认证 // 除上面外的所有请求全部需要鉴权认证
.anyRequest().authenticated(); .anyRequest().authenticated();