@Configuration
public class MyConfiguration {
@Bean
public WebMvcConfigurer corsConfigurer() {
return new WebMvcConfigurerAdapter() {
@Override
public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/api/**").allowedOrigins("https://blog.lqdev.cn");
}
};
}
}