|
|
@@ -1,28 +0,0 @@
|
|
|
-package com.uas.ps.inquiry;
|
|
|
-
|
|
|
-import org.springframework.context.annotation.Configuration;
|
|
|
-import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
|
|
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
|
|
-
|
|
|
-/**
|
|
|
- * @author liusw
|
|
|
- * @version 2018/1/23 16:53
|
|
|
- */
|
|
|
-@Configuration
|
|
|
-public class CorsConfig extends WebMvcConfigurerAdapter {
|
|
|
-
|
|
|
- /**
|
|
|
- * 跨域问题
|
|
|
- * @param registry
|
|
|
- */
|
|
|
- @Override
|
|
|
- public void addCorsMappings(final CorsRegistry registry) {
|
|
|
- registry.addMapping("/**")
|
|
|
- .allowedOrigins("*")
|
|
|
- .allowCredentials(true)
|
|
|
- .allowedMethods("GET", "POST", "DELETE", "PUT")
|
|
|
- .maxAge(3600)
|
|
|
- .allowedHeaders("Access-Control-Allow-Origin: *");
|
|
|
- }
|
|
|
-
|
|
|
-}
|