Merge pull request #9897 from dataease/pr@dev-v2@perf_div_embedded_cors

perf: div嵌入式跨域设置
This commit is contained in:
fit2cloud-chenyw 2024-05-28 10:03:33 +08:00 committed by GitHub
commit 913b99131d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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