fix: 放行文档

This commit is contained in:
2026-01-08 00:50:12 +08:00
parent 4a4a010f83
commit 9a20a52afb
3 changed files with 3 additions and 7 deletions

View File

@@ -27,7 +27,7 @@ public class SecurityConfiguration {
.sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
.authorizeHttpRequests(auth -> auth
.requestMatchers("/v1/auth/**", "/oauth2/**", "/.well-known/**", "/doc.html", "/swagger-ui/**",
"/swagger-resources/**", "/webjars/**", "/v3/api-docs/**", "/favicon.ico")
"/swagger-resources/**", "/webjars/**", "/v3/api-docs/**", "/v3/api-docs", "/favicon.ico")
.permitAll()
.anyRequest()
.authenticated())

View File

@@ -99,7 +99,8 @@ public class JwtAuthenticationFilter extends OncePerRequestFilter {
// 跳过不需要JWT验证的路径
return path.startsWith("/v1/auth/") || path.startsWith("/doc.html") || path.startsWith("/swagger-ui/")
|| path.startsWith("/swagger-resources/") || path.startsWith("/webjars/")
|| path.startsWith("/v3/api-docs/") || path.equals("/favicon.ico");
|| path.startsWith("/v3/api-docs") || path.equals("/favicon.ico")
|| path.contains("/v3/api-docs");
}
}