You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

59 lines
1.2 KiB

@echo off
echo ================================
echo 快速修复 404 错误
echo ================================
echo.
echo [1] 停止所有服务...
taskkill /f /im go.exe >nul 2>&1
taskkill /f /im node.exe >nul 2>&1
timeout /t 2 /nobreak >nul
echo [2] 清理Go模块缓存...
cd backend
go clean -modcache >nul 2>&1
go mod tidy
echo ✅ Go模块已更新
echo [3] 测试编译...
go build -o test.exe main.go
if %errorlevel% neq 0 (
echo ❌ 编译失败!请检查代码错误
pause
exit /b 1
)
del test.exe >nul 2>&1
echo ✅ 编译成功
echo [4] 启动后端...
start /b go run main.go
cd ..
echo [5] 等待后端启动...
timeout /t 5 /nobreak >nul
echo [6] 测试API连接...
echo 测试基本API...
curl -s http://localhost:8080/api/test
echo.
echo.
echo 测试登录API...
curl -s -X POST http://localhost:8080/api/auth/test-login
echo.
echo.
echo [7] 启动前端...
cd frontend
start /b npm run dev
cd ..
echo.
echo ================================
echo 修复完成!
echo ================================
echo.
echo 🌐 前端: http://localhost:5173
echo 🔧 后端: http://localhost:8080
echo.
echo 如果仍有问题,请查看 TROUBLESHOOTING.md
pause