package com.wayneleo.quickstart.framework.core.conf;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@Configuration
public class CrossOrign extends WebMvcConfigurerAdapter {
    @Override
    public void addCorsMappings( CorsRegistry registry ) {
        registry.addMapping( "/**" );
    }
}

@@ -444,16 +444,215 @@
  %22/**%22 )
+%0A                .allowedOrigins( %22*%22 )%0A                .allowedMethods( %22GET%22, %22HEAD%22, %22POST%22, %22PUT%22, %22DELETE%22, %22OPTIONS%22 )%0A                .allowCredentials( false )%0A                .maxAge( 3600 )
 ;%0A    %7D%0A

修复 cors 跨域问题