feat(N/A): 修改dev环境的cors配置

This commit is contained in:
guo
2025-10-26 12:39:22 +08:00
parent c30d443cc5
commit b72571697c
3 changed files with 3 additions and 1 deletions
@@ -9,5 +9,6 @@ import org.springframework.context.annotation.Configuration;
@ConfigurationProperties(prefix = "cors") @ConfigurationProperties(prefix = "cors")
public class CorsProperties { public class CorsProperties {
private String[] allowedOrigins; private String[] allowedOrigins;
private Boolean allowCredentials;
} }
@@ -24,6 +24,6 @@ public class WebCorsConfig implements WebMvcConfigurer {
.allowedOrigins(corsProperties.getAllowedOrigins()) .allowedOrigins(corsProperties.getAllowedOrigins())
.allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS") .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS")
.allowedHeaders("*") .allowedHeaders("*")
.allowCredentials(true); .allowCredentials(null == corsProperties.getAllowCredentials() || corsProperties.getAllowCredentials());
} }
} }
+1
View File
@@ -9,6 +9,7 @@ server:
port: 5155 port: 5155
cors: cors:
allowCredentials: false
allowed-origins: allowed-origins:
- '*' - '*'