Ai_GirlFriend/重启服务.bat
2026-02-28 09:40:18 +08:00

50 lines
1.1 KiB
Batchfile
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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.
echo 正在关闭所有 PHP 和 Python 进程...
echo.
REM 关闭所有 PHP 进程
taskkill /F /IM php.exe >nul 2>&1
if %errorlevel% equ 0 (
echo ✅ PHP 进程已关闭
) else (
echo 没有运行中的 PHP 进程
)
REM 关闭所有 Python 进程(只关闭 uvicorn
taskkill /F /IM python.exe /FI "WINDOWTITLE eq *uvicorn*" >nul 2>&1
if %errorlevel% equ 0 (
echo ✅ Python 进程已关闭
) else (
echo 没有运行中的 Python 进程
)
echo.
echo 等待 3 秒...
timeout /t 3 /nobreak >nul
echo.
echo ========================================
echo 🚀 启动服务
echo ========================================
echo.
REM 启动项目
start "" "%~dp0启动项目.bat"
echo.
echo ✅ 服务正在启动...
echo.
echo 请等待两个窗口打开:
echo 1⃣ PHP 服务器窗口
echo 2⃣ Python 后端窗口
echo.
echo 等待服务完全启动后(约 10-15 秒),再测试移动端登录。
echo.
pause