删除360SEO的js报错

This commit is contained in:
xiongxiaoyang
2019-12-28 10:37:48 +08:00
parent f0d9d5bf8a
commit 3de7167727
4 changed files with 18 additions and 6 deletions

View File

@ -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<ContextRefreshedEvent>
@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(() -> {