REM === 本脚本为辅助工具,主启动请用 start.bat === @echo off chcp 65001 >nul title Restart ShuiLi ZhiXue Backend (port 8000) REM ===== 重启后端无需管理员权限,全程在当前用户权限内完成(不弹 UAC)===== echo ============================================================ echo Restarting backend... (kill old process ^> start new ^> verify) echo ============================================================ powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0restart.ps1" echo. echo ------------------------------------------------------------ powershell -NoProfile -Command "if (Get-NetTCPConnection -LocalPort 8000 -State Listen -ErrorAction SilentlyContinue) { Write-Host 'RESULT: BACKEND_OK - port 8000 is listening, new code loaded.' -ForegroundColor Green } else { Write-Host 'RESULT: BACKEND_FAILED - port 8000 not listening, check backend\data\logs\manual_restart.log' -ForegroundColor Red }" echo ------------------------------------------------------------ echo. pause