标签:method als over reg source -o false methods pre
response.setHeader("Access-Control-Allow-Origin", "*");
response.setHeader("Access-Control-Allow-Headers", "*");
response.setHeader("Access-Control-Allow-Methods", "*");
WebMvcConfigurer
接口,并重写 addCorsMappings
方法@Override
public void addCorsMappings(CorsRegistry registry) {
registry
.addMapping("/**")
.allowedOrigins("*")
.allowedHeaders("*")
.allowedMethods("*")
.allowCredentials(false)
.maxAge(3600);
}
标签:method als over reg source -o false methods pre
原文地址:https://www.cnblogs.com/StarUDream/p/9045541.html