diff --git a/start_all.bat b/start_all.bat index 7197429..fa54f21 100644 --- a/start_all.bat +++ b/start_all.bat @@ -32,7 +32,15 @@ echo :8000 就绪 :: 3. 前端 echo [3/3] 前端 :5173 -start "jrxml-frontend" /MIN cmd /c "cd /d "%~dp0frontend" && npm run dev" +if not exist "%~dp0frontend\node_modules" ( + echo [安装] node_modules 不存在,正在 npm install... + cd /d "%~dp0frontend" + call npm install + cd /d "%~dp0" +) +cd /d "%~dp0frontend" +start "jrxml-frontend" /MIN cmd /c "npm run dev" +cd /d "%~dp0" :wait_fe ping -n 3 127.0.0.1 >nul powershell -Command "try{$r=Invoke-WebRequest -Uri http://localhost:5173 -TimeoutSec 3 -UseBasicParsing;exit 0}catch{exit 1}" >nul 2>&1