|
|
|
@ -69,9 +69,12 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
|
|
|
|
// 关闭csrf token认证不需要csrf防护
|
|
|
|
|
.csrf().disable();
|
|
|
|
|
|
|
|
|
|
// 关闭Session会话管理器
|
|
|
|
|
// 关闭Session会话管理器 JWT 不需要
|
|
|
|
|
http.sessionManagement().disable();
|
|
|
|
|
|
|
|
|
|
// 关闭记住我功能 JWT 不需要
|
|
|
|
|
http.rememberMe().disable();
|
|
|
|
|
|
|
|
|
|
// 初始化 initAuthorizeRequests
|
|
|
|
|
this.initAuthorizeRequests(http);
|
|
|
|
|
}
|
|
|
|
@ -108,6 +111,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
|
|
|
|
http.addFilterBefore(new JwtAuthenticationTokenFilter(uidUserDetailDetailService),
|
|
|
|
|
UsernamePasswordAuthenticationFilter.class);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 异常处理
|
|
|
|
|
http.exceptionHandling()
|
|
|
|
|
.accessDeniedHandler(accessDeniedHandler)
|
|
|
|
|