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 {
305
305
// 打印项目信息
306
306
PrintApplicationInfo . print(context);
307
307
// 打印项目提示
308
- PrintApplicationInfo . printTip();
308
+ PrintApplicationInfo . printTip(context );
309
309
}
310
310
311
311
}
Original file line number Diff line number Diff line change @@ -305,7 +305,7 @@ public class SpringBootPlusApplication {
305
305
// Print Project Info
306
306
PrintApplicationInfo . print(context);
307
307
// Print Project Tip
308
- PrintApplicationInfo . printTip();
308
+ PrintApplicationInfo . printTip(context );
309
309
}
310
310
311
311
}
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ public static void main(String[] args) {
48
48
// 打印项目信息
49
49
PrintApplicationInfo .print (context );
50
50
// 打印项目提示
51
- PrintApplicationInfo .printTip ();
51
+ PrintApplicationInfo .printTip (context );
52
52
}
53
53
54
54
}
Original file line number Diff line number Diff line change @@ -35,7 +35,10 @@ public class PrintApplicationInfo {
35
35
/**
36
36
* 执行之前,打印前置条件提示
37
37
*/
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" );
39
42
StringBuffer tip = new StringBuffer ();
40
43
tip .append ("===========================================================================================\n " );
41
44
tip .append (" \n " );
@@ -59,7 +62,9 @@ public static void printTip() {
59
62
tip .append (" 8.QQ:625301326,进群答案:springboot.plus\n " );
60
63
tip .append (" \n " );
61
64
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
+ }
63
68
}
64
69
65
70
/**
You can’t perform that action at this time.
0 commit comments