From 3de71677271f921948507d23346442422feab714 Mon Sep 17 00:00:00 2001
From: xiongxiaoyang <773861846@qq.com>
Date: Sat, 28 Dec 2019 10:37:48 +0800
Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4360SEO=E7=9A=84js=E6=8A=A5?=
=?UTF-8?q?=E9=94=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
novel-front/pom.xml | 6 ++++++
.../zinglizingli/books/core/listener/StartListener.java | 9 +++++++++
novel-front/src/main/resources/application.yml | 3 +++
.../src/main/resources/templates/common/footer.html | 6 ------
4 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/novel-front/pom.xml b/novel-front/pom.xml
index 5ed9a77..4529a3b 100644
--- a/novel-front/pom.xml
+++ b/novel-front/pom.xml
@@ -88,6 +88,12 @@
4.5.6
+
+ commons-configuration
+ commons-configuration
+ 1.10
+
+
org.springframework.boot
spring-boot-starter-mail
diff --git a/novel-front/src/main/java/xyz/zinglizingli/books/core/listener/StartListener.java b/novel-front/src/main/java/xyz/zinglizingli/books/core/listener/StartListener.java
index fc0d867..70a1c48 100644
--- a/novel-front/src/main/java/xyz/zinglizingli/books/core/listener/StartListener.java
+++ b/novel-front/src/main/java/xyz/zinglizingli/books/core/listener/StartListener.java
@@ -1,7 +1,9 @@
package xyz.zinglizingli.books.core.listener;
import lombok.RequiredArgsConstructor;
+import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.configuration.PropertiesConfiguration;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
@@ -22,8 +24,15 @@ public class StartListener implements ApplicationListener
@Value("${crawl.book.new.enabled}")
private String crawlEnable;
+ @Value("${website.name}")
+ private String webSiteName;
+
+ @SneakyThrows
@Override
public void onApplicationEvent(ContextRefreshedEvent event) {
+ PropertiesConfiguration conf = new PropertiesConfiguration("messages.properties");
+ conf.setProperty("website.name", webSiteName);
+ conf.save();
if (!Constants.ENABLE_NEW_BOOK.equals(crawlEnable.trim())) {
log.info("程序启动");
new Thread(() -> {
diff --git a/novel-front/src/main/resources/application.yml b/novel-front/src/main/resources/application.yml
index 71c8a2d..eef66ae 100644
--- a/novel-front/src/main/resources/application.yml
+++ b/novel-front/src/main/resources/application.yml
@@ -1,3 +1,6 @@
+website:
+ name: 笔趣阁新书门
+
server:
port: 8080
diff --git a/novel-front/src/main/resources/templates/common/footer.html b/novel-front/src/main/resources/templates/common/footer.html
index c69cf7c..03c9300 100644
--- a/novel-front/src/main/resources/templates/common/footer.html
+++ b/novel-front/src/main/resources/templates/common/footer.html
@@ -10,10 +10,4 @@
-
\ No newline at end of file