解决swagger无法访问问题,以及swagger报404问题

This commit is contained in:
猫萌萌
2022-01-13 18:52:15 +08:00
parent 869dcf73f8
commit c601a9a052
4 changed files with 9 additions and 7 deletions

View File

@ -96,8 +96,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()
// 过滤请求
.authorizeRequests()
// 对于登录login 注册register 验证码captchaImage 允许匿名访问
.antMatchers("/login", "/register", "/captchaImage").anonymous()
// 对于登录login 注册register 验证码captchaImage 允许匿名访问,tool下的路径放开验证
.antMatchers("/login", "/register", "/captchaImage","/tool/*").anonymous()
.antMatchers(
HttpMethod.GET,
"/",
@ -107,7 +107,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
"/**/*.js",
"/profile/**"
).permitAll()
.antMatchers("/swagger-ui.html").anonymous()
.antMatchers("/swagger-ui/*").anonymous()
.antMatchers("/swagger-resources/**").anonymous()
.antMatchers("/webjars/**").anonymous()
.antMatchers("/*/api-docs").anonymous()