/**
* 跨域设置
* @Version 1.0.0
* @Description
*/
@Configuration
public class CorsConfig extends WebMvcConfigurationSupport {
@Override
protected void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOrigins("*")
.allowCredentials(true)
.allowedMethods("GET","POST","DELETE","PUT")
.maxAge(3600);
}
}
原文:https://www.cnblogs.com/lazyli/p/12228931.html