常用工具类——跨域配置类
作者:互联网
@Configuration public class CorsConfig implements WebMvcConfigurer { @Override public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/**") .allowedOrigins("*") .allowCredentials(true) .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS") .maxAge(3600); } }
标签:跨域,配置,maxAge,registry,addMapping,Override,常用工具,public 来源: https://www.cnblogs.com/heikedeblack/p/14980771.html