This commit is contained in:
songjinsheng
2022-08-16 08:36:53 +08:00
parent 52095ccd04
commit 854afa033d
19 changed files with 506 additions and 15 deletions

View File

@ -113,17 +113,17 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
.antMatchers("/webjars/**").anonymous()
.antMatchers("/login", "/captcha/get", "/captcha/check").permitAll()
.antMatchers("/*/api-docs").anonymous()
.antMatchers("/druid/**").anonymous();
.antMatchers("/druid/**").anonymous()
// // 除上面外的所有请求全部需要鉴权认证
// .anyRequest().authenticated()
// .and()
// .headers().frameOptions().disable();
// httpSecurity.logout().logoutUrl("/logout").logoutSuccessHandler(logoutSuccessHandler);
// // 添加JWT filter
// httpSecurity.addFilterBefore(authenticationTokenFilter, UsernamePasswordAuthenticationFilter.class);
// // 添加CORS filter
// httpSecurity.addFilterBefore(corsFilter, JwtAuthenticationTokenFilter.class);
// httpSecurity.addFilterBefore(corsFilter, LogoutFilter.class);
.anyRequest().authenticated()
.and()
.headers().frameOptions().disable();
httpSecurity.logout().logoutUrl("/logout").logoutSuccessHandler(logoutSuccessHandler);
// 添加JWT filter
httpSecurity.addFilterBefore(authenticationTokenFilter, UsernamePasswordAuthenticationFilter.class);
// 添加CORS filter
httpSecurity.addFilterBefore(corsFilter, JwtAuthenticationTokenFilter.class);
httpSecurity.addFilterBefore(corsFilter, LogoutFilter.class);
}
/**