增加局域网访问

This commit is contained in:
dekun
2026-05-19 01:00:26 +08:00
parent 0203a65973
commit 4ad0ebe581
7 changed files with 53 additions and 19 deletions
+3 -1
View File
@@ -22,6 +22,8 @@ if (-not (Test-Path "logs")) {
pm2 start ecosystem.config.cjs
pm2 save 2>$null
Write-Host ""
Write-Host "已启动。访问: http://127.0.0.1:5200" -ForegroundColor Green
$lan = (Get-NetIPAddress -AddressFamily IPv4 -ErrorAction SilentlyContinue | Where-Object { $_.IPAddress -notmatch '^127\.' -and $_.PrefixOrigin -ne 'WellKnown' } | Select-Object -First 1).IPAddress
Write-Host "已启动。本机: http://127.0.0.1:5200" -ForegroundColor Green
if ($lan) { Write-Host "局域网: http://${lan}:5200" -ForegroundColor Green }
Write-Host "查看状态: pm2 status" -ForegroundColor Cyan
Write-Host "查看日志: pm2 logs api-key-manager" -ForegroundColor Cyan