mirror of
https://github.com/201206030/novel-plus.git
synced 2025-06-24 04:46:37 +00:00
build: Java版本升级到21 & SpringBoot版本升级到2.7.18
This commit is contained in:
@ -20,6 +20,12 @@
|
||||
<artifactId>novel-common</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.yaml</groupId>
|
||||
<artifactId>snakeyaml</artifactId>
|
||||
<version>2.2</version>
|
||||
</dependency>
|
||||
|
||||
<!--JWT(Json Web Token)登录支持-->
|
||||
<dependency>
|
||||
<groupId>io.jsonwebtoken</groupId>
|
||||
@ -48,7 +54,6 @@
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
<version>${jackson.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
@ -5,36 +5,34 @@ import com.java2nb.novel.entity.WebsiteInfo;
|
||||
import com.java2nb.novel.mapper.WebsiteInfoMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.boot.web.servlet.ServletContextInitializer;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.servlet.ServletContextEvent;
|
||||
import javax.servlet.ServletContextListener;
|
||||
import javax.servlet.annotation.WebListener;
|
||||
import javax.servlet.ServletContext;
|
||||
|
||||
/**
|
||||
* 启动监听器
|
||||
*
|
||||
* @author xiongxiaoyang
|
||||
*/
|
||||
@WebListener
|
||||
@Component
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class StarterListener implements ServletContextListener {
|
||||
public class StarterListener implements ServletContextInitializer {
|
||||
|
||||
private final WebsiteProperties websiteProperties;
|
||||
|
||||
private final WebsiteInfoMapper websiteInfoMapper;
|
||||
|
||||
@Override
|
||||
public void contextInitialized(ServletContextEvent sce) {
|
||||
sce.getServletContext()
|
||||
.setAttribute("website", websiteInfoMapper.selectByPrimaryKey(1L).orElse(new WebsiteInfo() {{
|
||||
setName(websiteProperties.getName());
|
||||
setDomain(websiteProperties.getDomain());
|
||||
setKeyword(websiteProperties.getKeyword());
|
||||
setDescription(websiteProperties.getDescription());
|
||||
setQq(websiteProperties.getQq());
|
||||
setLogo("/images/logo.png");
|
||||
setLogoDark("/images/logo_white.png");
|
||||
}}));
|
||||
public void onStartup(ServletContext servletContext) {
|
||||
servletContext.setAttribute("website", websiteInfoMapper.selectByPrimaryKey(1L).orElse(new WebsiteInfo() {{
|
||||
setName(websiteProperties.getName());
|
||||
setDomain(websiteProperties.getDomain());
|
||||
setKeyword(websiteProperties.getKeyword());
|
||||
setDescription(websiteProperties.getDescription());
|
||||
setQq(websiteProperties.getQq());
|
||||
setLogo("/images/logo.png");
|
||||
setLogoDark("/images/logo_white.png");
|
||||
}}));
|
||||
}
|
||||
}
|
||||
|
@ -5,6 +5,8 @@ spring:
|
||||
profiles:
|
||||
active: dev
|
||||
include: website,alipay,oss
|
||||
config:
|
||||
use-legacy-processing: true
|
||||
|
||||
jwt:
|
||||
secret: novel!#20191230
|
||||
|
Reference in New Issue
Block a user