From 8814f233bd87b672a388699c800894176049bb89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=8D=8E?= <672943942@qq.com> Date: Tue, 9 Jul 2019 09:56:52 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=AF=86=E7=A0=81=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 5c92b3f..f887258 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,5 +1,5 @@ server.port=9999 -spring.profiles.active= pro +spring.profiles.active= local server.servlet.context-path= / spring.aop.proxy-target-class=true # ============================== -- Gitee From 162b4a30bf240217817c31fd8096970f620f797d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=8D=8E?= <672943942@qq.com> Date: Tue, 9 Jul 2019 10:14:34 +0800 Subject: [PATCH 2/5] token --- src/main/java/com/fstack/validator/NewUserPwdValidator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/fstack/validator/NewUserPwdValidator.java b/src/main/java/com/fstack/validator/NewUserPwdValidator.java index f2f8878..9f1d06e 100644 --- a/src/main/java/com/fstack/validator/NewUserPwdValidator.java +++ b/src/main/java/com/fstack/validator/NewUserPwdValidator.java @@ -31,7 +31,7 @@ public class NewUserPwdValidator implements Validator { public void validate(Object object, Errors errors) { UserPwdDto userForm = (UserPwdDto) object; - // email validation + // token validation ValidationUtils.rejectIfEmptyOrWhitespace(errors, "token", "NotEmpty"); if (userForm.getToken() != null && !userForm.getToken().isEmpty()) { VerificationToken byToken = userService.findByToken(userForm.getToken()); -- Gitee From 64ffb4a457ccaaefdd0b7af20f69600e012b8169 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=8D=8E?= <672943942@qq.com> Date: Tue, 9 Jul 2019 10:28:18 +0800 Subject: [PATCH 3/5] footer --- src/main/resources/templates/fragments/footer.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/templates/fragments/footer.html b/src/main/resources/templates/fragments/footer.html index d0a7371..bf0c18d 100644 --- a/src/main/resources/templates/fragments/footer.html +++ b/src/main/resources/templates/fragments/footer.html @@ -4,7 +4,7 @@ -- Gitee From b3b3a6e0d7b8f152254c0b307b3eff5a37b81480 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=8D=8E?= <672943942@qq.com> Date: Tue, 9 Jul 2019 10:39:52 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E6=97=B6=E5=8C=BA=E7=BB=9F=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/fstack/FstackForumApplication.java | 8 ++++++++ src/main/resources/application-dev.properties | 2 +- src/main/resources/application-local.properties | 2 +- src/main/resources/application-pro.properties | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/fstack/FstackForumApplication.java b/src/main/java/com/fstack/FstackForumApplication.java index c3a6a4d..625dc27 100644 --- a/src/main/java/com/fstack/FstackForumApplication.java +++ b/src/main/java/com/fstack/FstackForumApplication.java @@ -1,6 +1,7 @@ package com.fstack; import java.util.Locale; +import java.util.TimeZone; import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; @@ -10,6 +11,8 @@ import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.web.servlet.LocaleResolver; import org.springframework.web.servlet.i18n.SessionLocaleResolver; +import javax.annotation.PostConstruct; + @MapperScan("com.fstack.persistence.dao") @EnableAsync @SpringBootApplication @@ -26,4 +29,9 @@ public class FstackForumApplication { return sessionLocaleResolver; } + @PostConstruct + void setDefaultTimezone() { + TimeZone.setDefault(TimeZone.getTimeZone("Asia/Shanghai")); + } + } \ No newline at end of file diff --git a/src/main/resources/application-dev.properties b/src/main/resources/application-dev.properties index 4275b23..da173a4 100644 --- a/src/main/resources/application-dev.properties +++ b/src/main/resources/application-dev.properties @@ -2,7 +2,7 @@ # MySQL connection config # ============================== spring.datasource.driverClassName = com.mysql.cj.jdbc.Driver -spring.datasource.url = jdbc:mysql://127.0.0.1:3306/fangrong?serverTimezone=GMT&useSSL=false&useUnicode=true&characterEncoding=UTF-8 +spring.datasource.url = jdbc:mysql://127.0.0.1:3306/fangrong?serverTimezone=GMT%2B8&useSSL=false&useUnicode=true&characterEncoding=UTF-8 spring.datasource.username = fangrong spring.datasource.password = GsWJAHJtNc2R85xx spring.datasource.type=com.zaxxer.hikari.HikariDataSource diff --git a/src/main/resources/application-local.properties b/src/main/resources/application-local.properties index 3e3a6d6..db10391 100644 --- a/src/main/resources/application-local.properties +++ b/src/main/resources/application-local.properties @@ -2,7 +2,7 @@ # MySQL connection config # ============================== spring.datasource.driverClassName = com.mysql.cj.jdbc.Driver -spring.datasource.url = jdbc:mysql://192.168.1.204:3306/forum?serverTimezone=GMT&useSSL=false&useUnicode=true&characterEncoding=UTF-8 +spring.datasource.url = jdbc:mysql://192.168.1.204:3306/forum?serverTimezone=GMT%2B8&useSSL=false&useUnicode=true&characterEncoding=UTF-8 spring.datasource.username = root spring.datasource.password = root spring.datasource.type=com.zaxxer.hikari.HikariDataSource diff --git a/src/main/resources/application-pro.properties b/src/main/resources/application-pro.properties index 664f81d..55dabdb 100644 --- a/src/main/resources/application-pro.properties +++ b/src/main/resources/application-pro.properties @@ -2,7 +2,7 @@ # MySQL connection config # ============================== spring.datasource.driverClassName = com.mysql.cj.jdbc.Driver -spring.datasource.url = jdbc:mysql://127.0.0.1:3306/fs_forum?zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=GMT&useSSL=false&useUnicode=true&characterEncoding=UTF-8 +spring.datasource.url = jdbc:mysql://127.0.0.1:3306/fs_forum?zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=GMT%2B8&useSSL=false&useUnicode=true&characterEncoding=UTF-8 spring.datasource.username = fstack spring.datasource.password = fstack spring.datasource.type=com.zaxxer.hikari.HikariDataSource -- Gitee From 9c9c323d539858e6cd05d63e6aaa73ed61844aec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=8D=8E?= <672943942@qq.com> Date: Tue, 9 Jul 2019 10:40:08 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E6=97=B6=E5=8C=BA=E7=BB=9F=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index f887258..5c92b3f 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,5 +1,5 @@ server.port=9999 -spring.profiles.active= local +spring.profiles.active= pro server.servlet.context-path= / spring.aop.proxy-target-class=true # ============================== -- Gitee