This commit is contained in:
Luk
2026-02-07 11:36:31 +08:00
parent e93db2d65f
commit f69b349835
5 changed files with 89 additions and 5 deletions

View File

@@ -9,7 +9,7 @@ const { execFileSync } = require('child_process')
let ip
try {
// 使用 curl 同步请求获取 IP
ip = execFileSync('curl', ['-s', 'https://api.ipify.org'], { encoding: 'utf8' }).trim()
ip = execFileSync('curl', ['-s', 'https://ifconfig.me'], { encoding: 'utf8' }).trim()
} catch (e) {
// 如果 curl 失败,降级为固定开发环境
ip = '0.0.0.0'