File tree Expand file tree Collapse file tree 4 files changed +10
-5
lines changed
bootstrap/src/main/java/io/geekidea/springbootplus
framework/src/main/java/io/geekidea/springbootplus/framework/util Expand file tree Collapse file tree 4 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -305,7 +305,7 @@ public class SpringBootPlusApplication {
305305 // 打印项目信息
306306 PrintApplicationInfo . print(context);
307307 // 打印项目提示
308- PrintApplicationInfo . printTip();
308+ PrintApplicationInfo . printTip(context );
309309 }
310310
311311}
Original file line number Diff line number Diff line change @@ -305,7 +305,7 @@ public class SpringBootPlusApplication {
305305 // Print Project Info
306306 PrintApplicationInfo . print(context);
307307 // Print Project Tip
308- PrintApplicationInfo . printTip();
308+ PrintApplicationInfo . printTip(context );
309309 }
310310
311311}
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ public static void main(String[] args) {
4848 // 打印项目信息
4949 PrintApplicationInfo .print (context );
5050 // 打印项目提示
51- PrintApplicationInfo .printTip ();
51+ PrintApplicationInfo .printTip (context );
5252 }
5353
5454}
Original file line number Diff line number Diff line change @@ -35,7 +35,10 @@ public class PrintApplicationInfo {
3535 /**
3636 * 执行之前,打印前置条件提示
3737 */
38- public static void printTip () {
38+ public static void printTip (ConfigurableApplicationContext context ) {
39+ ConfigurableEnvironment environment = context .getEnvironment ();
40+ // 项目profile
41+ String profileActive = environment .getProperty ("spring.profiles.active" );
3942 StringBuffer tip = new StringBuffer ();
4043 tip .append ("===========================================================================================\n " );
4144 tip .append (" \n " );
@@ -59,7 +62,9 @@ public static void printTip() {
5962 tip .append (" 8.QQ:625301326,进群答案:springboot.plus\n " );
6063 tip .append (" \n " );
6164 tip .append ("===========================================================================================\n " );
62- log .info ("\n {}" , Ansi .ansi ().eraseScreen ().fg (Ansi .Color .YELLOW ).a (tip .toString ()).reset ().toString ());
65+ if ("dev" .equals (profileActive )) {
66+ log .info ("\n {}" , Ansi .ansi ().eraseScreen ().fg (Ansi .Color .YELLOW ).a (tip .toString ()).reset ().toString ());
67+ }
6368 }
6469
6570 /**
You can’t perform that action at this time.
0 commit comments