白名单添加

This commit is contained in:
2025-10-26 13:16:27 +08:00
parent 1f2a56dd37
commit a16e4ca761
2 changed files with 7 additions and 1 deletions

View File

@@ -111,7 +111,9 @@ public class SecurityConfig
.authorizeHttpRequests((requests) -> {
permitAllUrl.getUrls().forEach(url -> requests.antMatchers(url).permitAll());
// 对于登录login 注册register 验证码captchaImage 允许匿名访问
requests.antMatchers("/login", "/register", "/captchaImage","/aiCommon/**","/voice-websocket/**").permitAll()
requests.antMatchers("/login", "/register", "/captchaImage","/aiCommon/**",
"/voice-websocket/**","/verification/email/send","/verification/email/verify","/verification/phone/send",
"/forgotPassword").permitAll()
// 静态资源,可匿名访问
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
.antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()