peixue-dev/Archive/[一次性]完整重启后端-重新编译-2026-02-01.bat

48 lines
1.1 KiB
Batchfile
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@echo off
chcp 65001 >nul
echo ========================================
echo 完整重启后端服务 - 游客模式修复
echo ========================================
echo.
echo [1/4] 停止后端服务...
cd /d "%~dp0..\peidu\backend"
taskkill /F /IM java.exe 2>nul
timeout /t 3 /nobreak >nul
echo 后端服务已停止
echo.
echo [2/4] 清理编译缓存...
if exist target (
rmdir /s /q target
echo 已清理 target 目录
)
echo.
echo [3/4] 重新编译后端...
call mvn clean package -DskipTests
if %errorlevel% neq 0 (
echo 编译失败!请检查错误信息
pause
exit /b 1
)
echo 编译成功!
echo.
echo [4/4] 启动后端服务...
start "Peidu Backend" cmd /k "cd /d %~dp0..\peidu\backend && java -jar target\peidu-backend-1.0.0.jar"
echo 后端服务启动中...
echo 请等待约30秒让服务完全启动
echo.
echo ========================================
echo 后端服务重启完成!
echo ========================================
echo.
echo 接下来请:
echo 1. 等待后端服务完全启动约30秒
echo 2. 运行前端清除缓存并重新编译脚本
echo 3. 测试游客模式下的三个页面
echo.
pause