@Configurationpublic class CrossConfig implements WebMvcConfigurer { @Override public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/**") .allowedOrigins("*") .allowCredentials(true) .allowedMethods("GET", "POST", "DELETE", "PUT") .maxAge(3600); } }
原文地址:https://www.cnblogs.com/-llf/p/12049012.html
时间: 2024-11-10 07:35:20