添加 cors 策略 允许跨域

This commit is contained in:
shikong 2023-10-10 17:04:16 +08:00
parent 3ea5ac5deb
commit 44470dddb7

View File

@ -24,7 +24,7 @@ public class WebConfig implements WebMvcConfigurer {
@Override
public void addCorsMappings(CorsRegistry corsRegistry){
corsRegistry.addMapping("/**")
.allowedOrigins("*")
.allowedOriginPatterns("*")
.allowCredentials(true)
.allowedMethods("GET","POST","HEAD","DELETE","PUT")
.allowedHeaders("*")