解决跨域问题
作者:互联网
后端解决配置类:
/** * 解决跨域问题 */ @Configuration public class CorsConfig implements WebMvcConfigurer { @Override public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/**") .allowedOrigins("*") .allowedMethods("GET", "HEAD", "POST", "PUT", "DELETE", "OPTIONS") .allowCredentials(true) .maxAge(3600) .allowedHeaders("*"); } }
标签:跨域,maxAge,问题,registry,addMapping,解决,public 来源: https://www.cnblogs.com/leviAckman/p/16415574.html