From b6f14a410e20cdecff99bde338127b42780a343b Mon Sep 17 00:00:00 2001
From: cjl <276999030@qq.com>
Date: Wed, 23 Aug 2023 13:11:51 +0800
Subject: [PATCH] fix:部分功能修改
---
screen-api/src/main/java/com/moral/api/config/Interceptor/WebAppConfiguration.java | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/screen-api/src/main/java/com/moral/api/config/Interceptor/WebAppConfiguration.java b/screen-api/src/main/java/com/moral/api/config/Interceptor/WebAppConfiguration.java
index f1cde10..ee0343b 100644
--- a/screen-api/src/main/java/com/moral/api/config/Interceptor/WebAppConfiguration.java
+++ b/screen-api/src/main/java/com/moral/api/config/Interceptor/WebAppConfiguration.java
@@ -4,10 +4,7 @@
import org.springframework.boot.system.ApplicationHome;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
-import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
-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 org.springframework.web.servlet.config.annotation.*;
import java.util.ArrayList;
@@ -31,6 +28,18 @@
regisration.excludePathPatterns(excludePath);//���������������������
}
+ @Override
+ public void addCorsMappings(CorsRegistry registry) {
+ registry.addMapping("/**")
+ //������������Cookie
+ .allowCredentials(true)
+ //���������������������
+ .allowedOrigins("*")
+ .allowedMethods(new String[]{"GET", "POST", "PUT", "DELETE"})
+ .allowedHeaders("*")
+ .exposedHeaders("*");
+ }
+
/**
* ���������������������������������������������������������
*
--
Gitblit v1.8.0