From cae7cd0064a2cebb6d99f6c4487644fb9b6e7cb4 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Tue, 28 May 2024 10:01:48 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20div=E5=B5=8C=E5=85=A5=E5=BC=8F=E8=B7=A8?= =?UTF-8?q?=E5=9F=9F=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/dataease/auth/interceptor/CorsConfig.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sdk/common/src/main/java/io/dataease/auth/interceptor/CorsConfig.java b/sdk/common/src/main/java/io/dataease/auth/interceptor/CorsConfig.java index 35e39b1a3a..49d96768f6 100644 --- a/sdk/common/src/main/java/io/dataease/auth/interceptor/CorsConfig.java +++ b/sdk/common/src/main/java/io/dataease/auth/interceptor/CorsConfig.java @@ -5,6 +5,7 @@ import jakarta.annotation.Resource; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Configuration; import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.servlet.config.annotation.CorsRegistry; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.PathMatchConfigurer; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; @@ -30,4 +31,9 @@ public class CorsConfig implements WebMvcConfigurer { public void configurePathMatch(PathMatchConfigurer configurer) { configurer.addPathPrefix(AuthConstant.DE_API_PREFIX, c -> c.isAnnotationPresent(RestController.class) && c.getPackageName().startsWith("io.dataease")); } + + @Override + public void addCorsMappings(CorsRegistry registry) { + registry.addMapping("/**"); + } }