-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathdev.bat
More file actions
27 lines (22 loc) · 1.02 KB
/
dev.bat
File metadata and controls
27 lines (22 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
@echo off
chcp 65001 >nul
echo ======================================
echo 上课摸鱼搭子 - 一键开发模式
echo ======================================
echo.
echo [0/2] 清理旧后端进程...
taskkill /IM class-assistant-backend.exe /F >nul 2>&1
taskkill /FI "WINDOWTITLE eq ClassAssistant-Backend" /F >nul 2>&1
for /f "tokens=5" %%a in ('netstat -aon ^| findstr ":8765 " ^| findstr "LISTENING"') do taskkill /PID %%a /F >nul 2>&1
timeout /t 1 >nul
echo [1/2] 启动后端服务 (FastAPI)...
start "" powershell -NoProfile -WindowStyle Hidden -Command "Set-Location '%~dp0api-service'; .venv\Scripts\python.exe -m uvicorn main:app --host 127.0.0.1 --port 8765 --reload *> '../data/_dev_backend.log'"
echo 等待后端就绪...
timeout /t 4 >nul
echo [2/2] 启动前端 Tauri 开发模式...
cd /d %~dp0app-ui
npm run tauri dev
echo.
echo [清理] 关闭后端服务...
:: 兜底:按端口杀残留进程
for /f "tokens=5" %%a in ('netstat -aon ^| findstr ":8765 " ^| findstr "LISTENING"') do taskkill /PID %%a /F >nul 2>&1