diff --git a/server.exe b/server.exe deleted file mode 100644 index 7b2dc870..00000000 Binary files a/server.exe and /dev/null differ diff --git a/启动项目.bat b/启动项目.bat index 1bfa57ab..908cc320 100644 --- a/启动项目.bat +++ b/启动项目.bat @@ -3,9 +3,19 @@ title Warehouse Management System Launcher cd /d "%~dp0" +echo Building backend... +rem Rebuild on every launch so the executable can never be a stale one. +go build -o server.exe ./cmd/server +if errorlevel 1 ( + echo. + echo Backend build failed. Fix the errors above and run this launcher again. + pause + exit /b 1 +) + echo Starting backend (8082)... -rem Run the current source so local testing never uses an outdated server.exe. -start "Warehouse MMS - Backend" /D "%~dp0" cmd /k "go run ./cmd/server" +rem Work dir must stay at the project root: frontend/dist and uploads are relative paths. +start "Warehouse MMS - Backend" /D "%~dp0" cmd /k "server.exe" echo Starting frontend (8083)... start "Warehouse MMS - Frontend" /D "%~dp0frontend" cmd /k "npm run dev"