From 3e7c89bed1d6df44747192df5b62c95fcca10e7b Mon Sep 17 00:00:00 2001 From: Parker Date: Thu, 9 Feb 2023 14:05:22 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=99=A4=E5=8E=BB=E5=A4=9A=E4=BD=99Long?= =?UTF-8?q?=E5=A4=84=E7=90=86=E8=AE=BE=E7=BD=AE=20vue=E5=89=8D=E6=AE=B5?= =?UTF-8?q?=E5=B7=B2=E5=BC=95=E5=85=A5jsonlint=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../conf/SpringWebMvcConfig.java | 28 ------------------- 1 file changed, 28 deletions(-) diff --git a/opsli-base-support/opsli-core/src/main/java/org/opsli/core/autoconfigure/conf/SpringWebMvcConfig.java b/opsli-base-support/opsli-core/src/main/java/org/opsli/core/autoconfigure/conf/SpringWebMvcConfig.java index 03de664c..800c3b76 100644 --- a/opsli-base-support/opsli-core/src/main/java/org/opsli/core/autoconfigure/conf/SpringWebMvcConfig.java +++ b/opsli-base-support/opsli-core/src/main/java/org/opsli/core/autoconfigure/conf/SpringWebMvcConfig.java @@ -27,10 +27,6 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; -import org.springframework.web.cors.CorsConfiguration; -import org.springframework.web.cors.UrlBasedCorsConfigurationSource; -import org.springframework.web.filter.CorsFilter; -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; @@ -70,34 +66,10 @@ public class SpringWebMvcConfig implements WebMvcConfigurer, WebMvcRegistrations .addPathPrefix(apiPathProperties.getGlobalPrefix(),c -> c.isAnnotationPresent(ApiRestController.class)); } - /** - * 解决跨域问题 - * - * @param registry registry - */ -// @Override -// public void addCorsMappings(CorsRegistry registry) { -// registry.addMapping("/**") -// .allowedOriginPatterns("*") -// .allowedMethods("GET", "HEAD", "POST", "PUT", "DELETE", "OPTIONS") -// .allowedHeaders("*") -// .allowCredentials(true) -// .maxAge(7200); -// } - @Override public void addInterceptors(InterceptorRegistry registry) { // 加载特定拦截器 registry.addInterceptor(new UserAuthInterceptor()); WebMvcConfigurer.super.addInterceptors(registry); } - - @Bean - public MappingJackson2HttpMessageConverter getMappingJackson2HttpMessageConverter() { - ObjectMapper objectMapper = Jackson2ObjectMapperBuilder.json() - .serializerByType(Long.class, ToStringSerializer.instance) - .serializerByType(Long.TYPE, ToStringSerializer.instance) - .build(); - return new MappingJackson2HttpMessageConverter(objectMapper); - } }