From 7bf62612b7fb8d450f7fea98695a35eafa123a97 Mon Sep 17 00:00:00 2001 From: flying-hero <462087392@qq.com> Date: Sun, 5 Apr 2026 07:17:54 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20=E6=94=B9=E8=BF=9B=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E8=84=9A=E6=9C=AC=EF=BC=9A=E6=B7=BB=E5=8A=A0=E7=AB=AF?= =?UTF-8?q?=E5=8F=A3=E6=B8=85=E7=90=86=E5=92=8C=E9=94=99=E8=AF=AF=E6=A3=80?= =?UTF-8?q?=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- start-dev.sh | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/start-dev.sh b/start-dev.sh index f933ecc3..b40e5619 100755 --- a/start-dev.sh +++ b/start-dev.sh @@ -3,22 +3,37 @@ echo "🏛️ 启动龙虾议事厅开发环境..." +# 检查并停止旧服务 +echo "🧹 清理旧服务..." +pkill -f "meeting-room.*runserver" 2>/dev/null +pkill -f "frontend.*npm start" 2>/dev/null +sleep 2 + # 启动后端 echo "📦 启动后端..." cd backend nohup python3 manage.py runserver 0.0.0.0:8000 > /tmp/meeting-backend.log 2>&1 & BACKEND_PID=$! -echo "✅ 后端已启动 (PID: $BACKEND_PID)" - -# 等待后端启动 -sleep 3 +sleep 2 +if ps -p $BACKEND_PID > /dev/null; then + echo "✅ 后端已启动 (PID: $BACKEND_PID)" +else + echo "❌ 后端启动失败,请检查日志:/tmp/meeting-backend.log" + exit 1 +fi # 启动前端 echo "📦 启动前端..." cd ../frontend nohup npm start > /tmp/meeting-frontend.log 2>&1 & FRONTEND_PID=$! -echo "✅ 前端已启动 (PID: $FRONTEND_PID)" +sleep 3 +if ps -p $FRONTEND_PID > /dev/null; then + echo "✅ 前端已启动 (PID: $FRONTEND_PID)" +else + echo "❌ 前端启动失败,请检查日志:/tmp/meeting-frontend.log" + exit 1 +fi echo "" echo "=========================================="