解决办法
1.
@Configurationpublic class CorsConfig implements WebMvcConfigurer { @Override public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/**")// .allowedOrigins("*") .allowedOriginPatterns("*") .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS", "HEAD") .allowCredentials(true) .allowedHeaders("*"); }}
2.@CrossOrigin
出现的问题
解决办法
红框里的换绿的