优化 Application 启动完成输出的提示信息

This commit is contained in:
thinkgem
2025-10-19 13:24:42 +08:00
parent fd8d036cb1
commit 49d67f7b81
4 changed files with 26 additions and 25 deletions

View File

@@ -36,9 +36,9 @@ public class ${@StringUtils.capCamelCase(moduleCode)}Application extends SpringB
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(${@StringUtils.capCamelCase(moduleCode)}Application.class, args); SpringApplication.run(${@StringUtils.capCamelCase(moduleCode)}Application.class, args);
logger.info( logger.info(
"\r\n\r\n==============================================================\r\n" "\n\n==============================================================\n"
+ "\r\n " + ${@StringUtils.capCamelCase(moduleCode)}Application.class.getName() + " 启动完成。" + "\n " + ${@StringUtils.capCamelCase(moduleCode)}Application.class.getName() + " 启动完成。\n"
+ "\r\n\r\n==============================================================\r\n"); + "\n==============================================================\n");
} }
@Override @Override

View File

@@ -25,12 +25,12 @@ public class ApiApplication extends SpringBootServletInitializer {
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(ApiApplication.class, args); SpringApplication.run(ApiApplication.class, args);
logger.info( logger.info(
"\r\n\r\n==============================================================\r\n" "\n\n==============================================================\n"
+ "\r\n 启动完成接口地址http://127.0.0.1:" + "\n 启动完成接口地址http://127.0.0.1:{}\n"
+ Global.getProperty("server.port") + FileUtils.path("/" + "\n 默认管理账号: system 密码: admin\n"
+ Global.getProperty("server.servlet.context-path")) + "\n==============================================================\n",
+ "\r\n\r\n 默认管理账号: system 密码: admin" Global.getProperty("server.port") + FileUtils.path("/"
+ "\r\n\r\n==============================================================\r\n"); + Global.getProperty("server.servlet.context-path")));
} }
@Override @Override

View File

@@ -41,19 +41,20 @@ public class FastApplication extends SpringBootServletInitializer {
String ctxPath = Global.getProperty("server.servlet.context-path"); String ctxPath = Global.getProperty("server.servlet.context-path");
if (StringUtils.isNoneBlank(vuePath, ctxPath)) { if (StringUtils.isNoneBlank(vuePath, ctxPath)) {
logger.info( logger.info(
"\r\n\r\n==============================================================\r\n" "\n\n==============================================================\n"
+ "\r\n 提示:您修改了 server.servlet.context-path 参数,需要您" + "\n 提示:您修改了 server.servlet.context-path 参数,需要您"
+ "\r\n 同步修改 _app.config.js 中的 VITE_GLOB_API_URL_PREFIX 参数 " + "\n 同步修改 _app.config.js 中的 VITE_GLOB_API_URL_PREFIX 参数 "
+ "\r\n 请修改为 VITE_GLOB_API_URL_PREFIX=\"" + ctxPath + "\"" + "\n 请修改为 VITE_GLOB_API_URL_PREFIX=\"{}\" 并重新打包 Vue\n"
+ "\r\n\r\n==============================================================\r\n"); + "\n==============================================================\n",
ctxPath);
} }
logger.info( logger.info(
"\r\n\r\n==============================================================\r\n" "\n\n==============================================================\n"
+ "\r\n 启动完成访问地址http://127.0.0.1:" + "\n 启动完成访问地址http://127.0.0.1:{}\n"
+ Global.getProperty("server.port") + FileUtils.path("/" + "\n 默认管理账号: system 密码: admin\n"
+ Global.getProperty("server.servlet.context-path")) + "\n==============================================================\n",
+ "\r\n\r\n 默认管理账号: system 密码: admin" Global.getProperty("server.port") + FileUtils.path("/"
+ "\r\n\r\n==============================================================\r\n"); + Global.getProperty("server.servlet.context-path")));
} }
@Override @Override

View File

@@ -25,12 +25,12 @@ public class MiniApplication extends SpringBootServletInitializer {
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(MiniApplication.class, args); SpringApplication.run(MiniApplication.class, args);
logger.info( logger.info(
"\r\n\r\n==============================================================\r\n" "\n\n==============================================================\n"
+ "\r\n 启动完成,监控地址http://127.0.0.1:" + "\n 启动完成,访问地址http://127.0.0.1:{}\n"
+ Global.getProperty("server.port") + FileUtils.path("/" + "\n==============================================================\n",
Global.getProperty("server.port") + FileUtils.path("/"
+ Global.getProperty("server.servlet.context-path") + Global.getProperty("server.servlet.context-path")
+ Global.getAdminPath()) + "/state/server/index" + Global.getAdminPath()) + "/state/server/index");
+ "\r\n\r\n==============================================================\r\n");
} }
@Override @Override