|
@@ -11,6 +11,9 @@ import org.springframework.cloud.netflix.feign.EnableFeignClients;
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
import org.springframework.web.multipart.MultipartResolver;
|
|
|
import org.springframework.web.multipart.commons.CommonsMultipartResolver;
|
|
|
+import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
|
|
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|
|
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
|
|
|
|
|
|
|
|
* 项目入口主程序
|
|
@@ -39,4 +42,20 @@ public class App {
|
|
|
resolver.setMaxUploadSize(200*1024*1024);
|
|
|
return resolver;
|
|
|
}
|
|
|
+
|
|
|
+ @Bean
|
|
|
+ public WebMvcConfigurer corsConfigurer() {
|
|
|
+ return new WebMvcConfigurerAdapter() {
|
|
|
+ public void addCorsMappings(CorsRegistry registry) {
|
|
|
+ registry.addMapping("/**");
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ };
|
|
|
+ }
|
|
|
}
|