|
@@ -1,6 +1,8 @@
|
|
|
package com.zhentao.framework.config;
|
|
|
|
|
|
-import java.util.concurrent.TimeUnit;
|
|
|
+import com.zhentao.common.config.RuoYiConfig;
|
|
|
+import com.zhentao.common.constant.Constants;
|
|
|
+import com.zhentao.framework.interceptor.RepeatSubmitInterceptor;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
@@ -11,13 +13,12 @@ import org.springframework.web.filter.CorsFilter;
|
|
|
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
|
|
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
|
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|
|
-import com.zhentao.common.config.RuoYiConfig;
|
|
|
-import com.zhentao.common.constant.Constants;
|
|
|
-import com.zhentao.framework.interceptor.RepeatSubmitInterceptor;
|
|
|
+
|
|
|
+import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
/**
|
|
|
* 通用配置
|
|
|
- *
|
|
|
+ *
|
|
|
* @author ruoyi
|
|
|
*/
|
|
|
@Configuration
|
|
@@ -55,6 +56,7 @@ public class ResourcesConfig implements WebMvcConfigurer
|
|
|
public CorsFilter corsFilter()
|
|
|
{
|
|
|
CorsConfiguration config = new CorsConfiguration();
|
|
|
+ config.setAllowCredentials(true);
|
|
|
// 设置访问源地址
|
|
|
config.addAllowedOriginPattern("*");
|
|
|
// 设置访问源请求头
|
|
@@ -69,4 +71,4 @@ public class ResourcesConfig implements WebMvcConfigurer
|
|
|
// 返回新的CorsFilter
|
|
|
return new CorsFilter(source);
|
|
|
}
|
|
|
-}
|
|
|
+}
|