/** * 跨域设置 * @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
时间: 2024-10-07 15:27:53