From 0348349a86b64eb4dd959c29c339f75b2fdb26d9 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Fri, 3 Jan 2020 16:57:35 +0800 Subject: [PATCH] =?UTF-8?q?Jackson=E6=97=A5=E6=9C=9F=E5=8F=8D=E5=BA=8F?= =?UTF-8?q?=E5=88=97=E5=8C=96=E6=97=B6=E5=8C=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruoyi/framework/config/ApplicationConfig.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ruoyi/src/main/java/com/ruoyi/framework/config/ApplicationConfig.java b/ruoyi/src/main/java/com/ruoyi/framework/config/ApplicationConfig.java index 4dd33382..5a6da111 100644 --- a/ruoyi/src/main/java/com/ruoyi/framework/config/ApplicationConfig.java +++ b/ruoyi/src/main/java/com/ruoyi/framework/config/ApplicationConfig.java @@ -1,6 +1,9 @@ package com.ruoyi.framework.config; +import java.util.TimeZone; import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer; +import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.EnableAspectJAutoProxy; @@ -16,5 +19,12 @@ import org.springframework.context.annotation.EnableAspectJAutoProxy; @MapperScan("com.ruoyi.project.**.mapper") public class ApplicationConfig { - + /** + * 时区配置 + */ + @Bean + public Jackson2ObjectMapperBuilderCustomizer jacksonObjectMapperCustomization() + { + return jacksonObjectMapperBuilder -> jacksonObjectMapperBuilder.timeZone(TimeZone.getDefault()); + } }