不依赖spring-boot-starter-security
包
@Bean
CorsConfigurationSource corsConfigurationSource() {
CorsConfiguration configuration = new CorsConfiguration();
configuration.setAllowedOrigins(Arrays.asList("http://localhost:63342"));
configuration.setAllowedMethods(Arrays.asList("GET","POST", "PUT", "DELETE"));
// 如果所有的属性不全部配置,一定要执行该方法
configuration.applyPermitDefaultValues();
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
source.registerCorsC