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("/**"); + } }