修复工作
This commit is contained in:
@@ -59,8 +59,17 @@ public class InitServer implements CommandLineRunner {
|
||||
public void run(String... args) throws Exception {
|
||||
// 初始化自动播放
|
||||
this.initAutoPlay();
|
||||
// TODO 获取本机IP地址
|
||||
String ip = "localhost";
|
||||
// 获取服务器IP地址(支持环境变量配置)
|
||||
String ip = System.getenv("SERVER_HOST");
|
||||
if (StrUtil.isEmpty(ip)) {
|
||||
try {
|
||||
// 尝试获取本机IP
|
||||
InetAddress addr = InetAddress.getLocalHost();
|
||||
ip = addr.getHostAddress();
|
||||
} catch (Exception e) {
|
||||
ip = "localhost";
|
||||
}
|
||||
}
|
||||
// 获取http端口号
|
||||
String httpPort = this.env.getProperty("server.port");
|
||||
// 获取web路径
|
||||
|
||||
Reference in New Issue
Block a user