解决Springboot 的ajax跨域问题-动静分离
@SpringBootApplication public class FsSysApiApp { public static void main(String[] args) { SpringApplication.run(FsSysApiApp.class, args); } @Bean public WebMvcConfigurer corsConfigurer() { return new WebMvcConfigurerAdapter() { @Override public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/**") .allowedOrigins(new String[]{"http://b.aa.com:12345" ,"http://b.aa.com","http://c.aa.com"}); } }; } }