fix: 放行文档
This commit is contained in:
@@ -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())
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user