diff --git a/opsli-base-support/opsli-core/src/main/java/org/opsli/core/autoconfigure/conf/SecurityConfig.java b/opsli-base-support/opsli-core/src/main/java/org/opsli/core/autoconfigure/conf/SecurityConfig.java index 5c186ee..5e4aa29 100644 --- a/opsli-base-support/opsli-core/src/main/java/org/opsli/core/autoconfigure/conf/SecurityConfig.java +++ b/opsli-base-support/opsli-core/src/main/java/org/opsli/core/autoconfigure/conf/SecurityConfig.java @@ -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)