@echo off chcp 65001 >nul echo ======================================== echo AMT 网络扫描器 - 快速启动 echo ======================================== echo. echo [1/3] 检查后端服务... powershell -Command "try { Invoke-RestMethod -Uri 'http://localhost:5000/api/credentials' -Method GET -ErrorAction Stop | Out-Null; Write-Host ' ✓ 后端已运行' -ForegroundColor Green } catch { Write-Host ' ✗ 后端未运行,正在启动...' -ForegroundColor Yellow; Start-Process powershell -ArgumentList '-NoExit', '-Command', 'cd backend-csharp\AmtScanner.Api; dotnet run' }" timeout /t 2 >nul echo. echo [2/3] 检查前端服务... powershell -Command "try { Invoke-WebRequest -Uri 'http://localhost:3001' -Method GET -TimeoutSec 2 -ErrorAction Stop | Out-Null; Write-Host ' ✓ 前端已运行' -ForegroundColor Green } catch { Write-Host ' ✗ 前端未运行,正在启动...' -ForegroundColor Yellow; Start-Process powershell -ArgumentList '-NoExit', '-Command', 'cd frontend; npm run dev' }" timeout /t 2 >nul echo. echo [3/3] 打开浏览器... timeout /t 3 >nul start http://localhost:3001 echo. echo ======================================== echo 系统启动完成! echo ======================================== echo. echo 前端地址: http://localhost:3001 echo 后端地址: http://localhost:5000 echo API 文档: http://localhost:5000/swagger echo. echo 按任意键退出... pause >nul