feat(N/A): 修改dev环境的cors配置
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ server:
|
||||
port: 5155
|
||||
|
||||
cors:
|
||||
allowCredentials: false
|
||||
allowed-origins:
|
||||
- '*'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user