From 84b31313bf44027569a423f7bbeb40165df454b3 Mon Sep 17 00:00:00 2001 From: tanghc Date: Thu, 29 Aug 2019 13:02:32 +0800 Subject: [PATCH] 2.0 --- .../gitee/sop/adminserver/api/config/ConfigListApi.java | 1 - .../java/com/gitee/sop/adminserver/config/WebConfig.java | 8 +++++--- .../src/main/resources/application-dev.properties | 3 ++- sop-gateway/src/main/resources/application-dev.properties | 3 ++- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/api/config/ConfigListApi.java b/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/api/config/ConfigListApi.java index 9a97b169..3ee17826 100644 --- a/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/api/config/ConfigListApi.java +++ b/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/api/config/ConfigListApi.java @@ -10,5 +10,4 @@ import com.gitee.easyopen.doc.annotation.ApiDoc; @ApiDoc("配置列表") public class ConfigListApi { -// public } diff --git a/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/config/WebConfig.java b/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/config/WebConfig.java index 6208b9e7..15f6492f 100644 --- a/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/config/WebConfig.java +++ b/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/config/WebConfig.java @@ -41,9 +41,11 @@ public class WebConfig { ApiConfig apiConfig() { ApiConfig apiConfig = new ApiConfig(); apiConfig.setJsonResultSerializer(obj -> JSON.toJSONString(obj, - SerializerFeature.WriteDateUseDateFormat - , SerializerFeature.WriteNullStringAsEmpty - , SerializerFeature.WriteMapNullValue)); + SerializerFeature.WriteNullStringAsEmpty + , SerializerFeature.WriteMapNullValue + , SerializerFeature.WriteDateUseDateFormat) + ); + ApiSessionManager apiSessionManager = new ApiSessionManager(); // session有效期 int timeout = NumberUtils.toInt(accessTokenTimeout, 30); diff --git a/sop-admin/sop-admin-server/src/main/resources/application-dev.properties b/sop-admin/sop-admin-server/src/main/resources/application-dev.properties index 4e5b912e..8159ac44 100644 --- a/sop-admin/sop-admin-server/src/main/resources/application-dev.properties +++ b/sop-admin/sop-admin-server/src/main/resources/application-dev.properties @@ -3,6 +3,7 @@ spring.application.name=sop-admin # ------- 需要改的配置 ------- # mysql数据库账号 +mysql.host=localhost:3306 mysql.username=root mysql.password=root @@ -21,7 +22,7 @@ nacos.discovery.server-addr=${nacos.url} # 数据库配置 spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver -spring.datasource.url=jdbc:mysql://localhost:3306/sop?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull +spring.datasource.url=jdbc:mysql://${mysql.host}/sop?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai spring.datasource.username=${mysql.username} spring.datasource.password=${mysql.password} diff --git a/sop-gateway/src/main/resources/application-dev.properties b/sop-gateway/src/main/resources/application-dev.properties index abd12d2e..b45f0b42 100644 --- a/sop-gateway/src/main/resources/application-dev.properties +++ b/sop-gateway/src/main/resources/application-dev.properties @@ -3,6 +3,7 @@ spring.application.name=api-gateway # ------- 需要改的配置 ------- # mysql数据库账号 +mysql.host=localhost:3306 mysql.username=root mysql.password=root @@ -39,7 +40,7 @@ spring.cloud.nacos.discovery.server-addr=${nacos.url} nacos.config.server-addr=${nacos.url} spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver -spring.datasource.url=jdbc:mysql://localhost:3306/sop?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull +spring.datasource.url=jdbc:mysql://${mysql.host}/sop?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai spring.datasource.username=${mysql.username} spring.datasource.password=${mysql.password}