|
@@ -1,48 +1,48 @@
|
|
|
-package com.huimv.eartag2.manage.config;
|
|
|
-
|
|
|
-import org.springframework.context.annotation.Configuration;
|
|
|
-import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
|
|
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|
|
-
|
|
|
-/**
|
|
|
- * @Project : huimv.shiwan
|
|
|
- * @Package : com.huimv.biosafety.uface.controller
|
|
|
- * @Description : TODO
|
|
|
- * @Version : 1.0
|
|
|
- * @Author : ZhuoNing
|
|
|
- * @Create : 2020-12-25
|
|
|
- **/
|
|
|
-@Configuration
|
|
|
-public class CorsConfig implements WebMvcConfigurer {
|
|
|
-
|
|
|
- /**
|
|
|
- * 开启跨域
|
|
|
- */
|
|
|
- @Override
|
|
|
- public void addCorsMappings(CorsRegistry registry) {
|
|
|
- // 设置允许跨域的路由
|
|
|
- registry.addMapping("/**")
|
|
|
- // 设置允许跨域请求的域名
|
|
|
- .allowedOriginPatterns("*")
|
|
|
- // 是否允许证书(cookies)
|
|
|
- .allowCredentials(true)
|
|
|
- // 设置允许的方法
|
|
|
- .allowedMethods("*")
|
|
|
- // 跨域允许时间
|
|
|
- .maxAge(3600);
|
|
|
- }
|
|
|
-
|
|
|
+//package com.huimv.eartag2.manage.config;
|
|
|
+//
|
|
|
+//import org.springframework.context.annotation.Configuration;
|
|
|
+//import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
|
|
+//import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|
|
+//
|
|
|
+///**
|
|
|
+// * @Project : huimv.shiwan
|
|
|
+// * @Package : com.huimv.biosafety.uface.controller
|
|
|
+// * @Description : TODO
|
|
|
+// * @Version : 1.0
|
|
|
+// * @Author : ZhuoNing
|
|
|
+// * @Create : 2020-12-25
|
|
|
+// **/
|
|
|
+//@Configuration
|
|
|
+//public class CorsConfig implements WebMvcConfigurer {
|
|
|
+//
|
|
|
+// /**
|
|
|
+// * 开启跨域
|
|
|
+// */
|
|
|
// @Override
|
|
|
// public void addCorsMappings(CorsRegistry registry) {
|
|
|
-//// 设置允许跨域的路径
|
|
|
+// // 设置允许跨域的路由
|
|
|
// registry.addMapping("/**")
|
|
|
-//// 设置允许跨域请求的域名
|
|
|
-// .allowedOrigins("*")
|
|
|
-//// 是否允许证书
|
|
|
+// // 设置允许跨域请求的域名
|
|
|
+// .allowedOriginPatterns("*")
|
|
|
+// // 是否允许证书(cookies)
|
|
|
// .allowCredentials(true)
|
|
|
-// .allowedMethods("GET", "POST", "DELETE", "PUT","OPTIONS")
|
|
|
-// .allowedHeaders("*")
|
|
|
-//// 跨域允许时间
|
|
|
+// // 设置允许的方法
|
|
|
+// .allowedMethods("*")
|
|
|
+// // 跨域允许时间
|
|
|
// .maxAge(3600);
|
|
|
// }
|
|
|
-}
|
|
|
+//
|
|
|
+//// @Override
|
|
|
+//// public void addCorsMappings(CorsRegistry registry) {
|
|
|
+////// 设置允许跨域的路径
|
|
|
+//// registry.addMapping("/**")
|
|
|
+////// 设置允许跨域请求的域名
|
|
|
+//// .allowedOrigins("*")
|
|
|
+////// 是否允许证书
|
|
|
+//// .allowCredentials(true)
|
|
|
+//// .allowedMethods("GET", "POST", "DELETE", "PUT","OPTIONS")
|
|
|
+//// .allowedHeaders("*")
|
|
|
+////// 跨域允许时间
|
|
|
+//// .maxAge(3600);
|
|
|
+//// }
|
|
|
+//}
|