添加 cors 策略 允许跨域
This commit is contained in:
parent
3ea5ac5deb
commit
44470dddb7
@ -24,7 +24,7 @@ public class WebConfig implements WebMvcConfigurer {
|
|||||||
@Override
|
@Override
|
||||||
public void addCorsMappings(CorsRegistry corsRegistry){
|
public void addCorsMappings(CorsRegistry corsRegistry){
|
||||||
corsRegistry.addMapping("/**")
|
corsRegistry.addMapping("/**")
|
||||||
.allowedOrigins("*")
|
.allowedOriginPatterns("*")
|
||||||
.allowCredentials(true)
|
.allowCredentials(true)
|
||||||
.allowedMethods("GET","POST","HEAD","DELETE","PUT")
|
.allowedMethods("GET","POST","HEAD","DELETE","PUT")
|
||||||
.allowedHeaders("*")
|
.allowedHeaders("*")
|
||||||
|
Loading…
Reference in New Issue
Block a user