md
This commit is contained in:
parent
e7a650e817
commit
d662666e66
@ -8,6 +8,8 @@ import org.springframework.boot.builder.SpringApplicationBuilder;
|
|||||||
import org.springframework.boot.web.servlet.ServletComponentScan;
|
import org.springframework.boot.web.servlet.ServletComponentScan;
|
||||||
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
||||||
import org.springframework.cache.annotation.EnableCaching;
|
import org.springframework.cache.annotation.EnableCaching;
|
||||||
|
import org.springframework.context.ConfigurableApplicationContext;
|
||||||
|
import org.springframework.core.env.Environment;
|
||||||
import org.springframework.scheduling.annotation.EnableAsync;
|
import org.springframework.scheduling.annotation.EnableAsync;
|
||||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
|
|
||||||
@ -48,11 +50,22 @@ public class LaunchApplication extends SpringBootServletInitializer {
|
|||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
ConfigurableApplicationContext context =
|
||||||
new SpringApplicationBuilder(
|
new SpringApplicationBuilder(
|
||||||
LaunchApplication.class)
|
LaunchApplication.class)
|
||||||
.properties("spring.config.location=" + configFile)
|
.properties("spring.config.location=" + configFile)
|
||||||
.web(WebApplicationType.SERVLET).run(args);
|
.web(WebApplicationType.SERVLET).run(args);
|
||||||
|
|
||||||
|
// 获取Environment实例
|
||||||
|
Environment env = context.getEnvironment();
|
||||||
|
|
||||||
|
// 获取端口号和上下文路径
|
||||||
|
String serverPort = env.getProperty("server.port");
|
||||||
|
String contextPath = env.getProperty("server.servlet.context-path", "");
|
||||||
|
|
||||||
|
// 打印启动信息
|
||||||
|
System.out.println("\n\n==>系统启动成功!server.port=" + serverPort + " context-path=" + contextPath);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -80,7 +80,6 @@ token:
|
|||||||
# 令牌密钥
|
# 令牌密钥
|
||||||
secret: 10942fd6f30d45a567e7ec84b18f9ca7c1
|
secret: 10942fd6f30d45a567e7ec84b18f9ca7c1
|
||||||
# 令牌有效期(默认30分钟)
|
# 令牌有效期(默认30分钟)
|
||||||
# 72 小时过期时间
|
|
||||||
expireTime: 4320
|
expireTime: 4320
|
||||||
|
|
||||||
# MyBatis配置
|
# MyBatis配置
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user