|
|
|
|
@ -1,8 +1,18 @@
|
|
|
|
|
package com.ruoyi;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.net.NetUtil;
|
|
|
|
|
import com.ruoyi.common.config.RuoYiConfig;
|
|
|
|
|
import com.ruoyi.framework.config.ApplicationConfig;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.boot.SpringApplication;
|
|
|
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
|
|
|
import org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup;
|
|
|
|
|
import org.springframework.context.ApplicationContext;
|
|
|
|
|
import org.springframework.core.env.Environment;
|
|
|
|
|
|
|
|
|
|
import java.net.InetAddress;
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 启动程序
|
|
|
|
|
@ -11,14 +21,41 @@ import org.springframework.boot.context.metrics.buffering.BufferingApplicationSt
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
@SpringBootApplication
|
|
|
|
|
@Slf4j
|
|
|
|
|
public class RuoYiApplication {
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|
System.setProperty("spring.devtools.restart.enabled", "false");
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args)throws Exception {
|
|
|
|
|
// System.setProperty("spring.devtools.restart.enabled", "false");
|
|
|
|
|
SpringApplication application = new SpringApplication(RuoYiApplication.class);
|
|
|
|
|
application.setApplicationStartup(new BufferingApplicationStartup(2048));
|
|
|
|
|
application.run(args);
|
|
|
|
|
System.out.println("(♥◠‿◠)ノ゙ RuoYi-Vue-Plus启动成功 ლ(´ڡ`ლ)゙");
|
|
|
|
|
ApplicationContext act =application.run(args);
|
|
|
|
|
RuoYiConfig config = act.getBean(RuoYiConfig.class);
|
|
|
|
|
Environment environment = act.getEnvironment();
|
|
|
|
|
// System.out.println("(♥◠‿◠)ノ゙ RuoYi-Vue-Plus启动成功 ლ(´ڡ`ლ)゙");
|
|
|
|
|
System.setProperty("https.protocols", "TLSv1,TLSv1.1,TLSv1.2");
|
|
|
|
|
StringBuffer sb = new StringBuffer("\n\n");
|
|
|
|
|
sb.append("┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n");
|
|
|
|
|
sb.append("┃ 项目名称:" + config.getName() + "\n");
|
|
|
|
|
sb.append("┃ 项目版本:" + config.getVersion() + "\n");
|
|
|
|
|
sb.append("┃ 运行环境:" + environment.getProperty("spring.profiles.active","main") + "\n");
|
|
|
|
|
sb.append("┃ 运行模式:" + (config.getDev() ? "开发模式" : "生产模式") + "\n");
|
|
|
|
|
String port = ":"+environment.getProperty("server.port","8080");
|
|
|
|
|
if(":80".equals(port)){
|
|
|
|
|
port="";
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
// for(String s : NetUtil.localIps()) {
|
|
|
|
|
for(String s : NetUtil.localIpv4s()) {
|
|
|
|
|
sb.append("┃ 访问地址:http://" + s + port + "\n");
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
sb.append("┃ 访问地址:http://127.0.0.1" + port + "\n");
|
|
|
|
|
}
|
|
|
|
|
sb.append("┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n");
|
|
|
|
|
sb.append("\n\n\n");
|
|
|
|
|
log.info(sb.toString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|