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

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