diff --git a/07-start-frontend.sh b/07-start-frontend.sh index b70840a..a3aced0 100755 --- a/07-start-frontend.sh +++ b/07-start-frontend.sh @@ -7,7 +7,7 @@ # ./07-start-frontend.sh # 只启动指定项目 # # 项目与端口: -# pc → Electron + Vite :7777(无 GUI 时设 PC_WEB_ONLY=1 仅用浏览器 :5173) +# pc → 默认 yarn dev:web :5173(无 Electron);本机要 Electron 时设 PC_ELECTRON=1 使用 yarn dev # meetingh5 → React + Vite :5188 # h5 → Vue + Vite :3003 # cms → UMI Max :8001 @@ -55,7 +55,7 @@ declare -A FE_PM=( ) declare -A FE_CMD=( - [pc]="yarn dev" + [pc]="yarn dev:web" [meetingh5]="npm run dev" [h5]="npm run dev" [cms]="pnpm run dev" @@ -74,7 +74,7 @@ declare -A FE_ENV=( ) declare -A FE_PORT=( - [pc]=":7777 (Electron Vite 调试服务器)" + [pc]=":5173 (yarn dev:web)" [meetingh5]=":5188" [h5]=":3003" [cms]=":8001" @@ -82,10 +82,10 @@ declare -A FE_PORT=( [build-down]=":8003" ) -# 无 GUI / 缺 libatk 等:仅启动 Vite,浏览器访问(默认 :5173,可用 VITE_WEB_PORT 覆盖) -if [[ "${PC_WEB_ONLY:-}" == "1" ]] || [[ "${PC_WEB_ONLY:-}" == "true" ]]; then - FE_CMD[pc]="yarn dev:web" - FE_PORT[pc]=":5173 (Vite 浏览器,PC_WEB_ONLY)" +# 本机需 Electron 桌面客户端时:PC_ELECTRON=1 → yarn dev(需 GUI / libatk 等) +if [[ "${PC_ELECTRON:-}" == "1" ]] || [[ "${PC_ELECTRON:-}" == "true" ]]; then + FE_CMD[pc]="yarn dev" + FE_PORT[pc]=":5173 (yarn dev + Electron)" fi # ── 启动单个前端服务 ────────────────────────────────────────────────────────── @@ -184,7 +184,7 @@ if [[ "$TARGET" == "all" ]]; then echo "" echo -e "${BOLD}访问地址:${NC}" - echo " PC (Electron): yarn dev 启动后自动打开窗口" + echo " PC: http://${DEPLOY_TEST_IP}:5173 (默认 yarn dev:web;Electron 用 PC_ELECTRON=1 或 pc 目录内 yarn dev)" echo " H5: http://${DEPLOY_TEST_IP}:3003" echo " CMS: http://${DEPLOY_TEST_IP}:8001" echo " Build CMS: http://${DEPLOY_TEST_IP}:8002" diff --git a/status.sh b/status.sh index bf294d6..900d895 100755 --- a/status.sh +++ b/status.sh @@ -49,7 +49,7 @@ print_svc_status "build-server" ":8281" echo "" echo -e "${BOLD}[ 前端开发服务器 ]${NC}" declare -A FE_PORT_MAP=( - [pc]="7777 (Electron Vite)" + [pc]="5173 (yarn dev:web)" [meetingh5]="5188" [h5]="3003" [cms]="8001" @@ -69,7 +69,7 @@ done # ── 端口占用检查 ────────────────────────────────────────────────────────────── echo "" echo -e "${BOLD}[ 端口占用 ]${NC}" -PORTS=(10002 10001 10008 10009 8000 8080 8081 8281 7777 5188 3003 8001 8002 8003) +PORTS=(10002 10001 10008 10009 8000 8080 8081 8281 5173 5188 3003 8001 8002 8003) for port in "${PORTS[@]}"; do pid=$(lsof -ti :"$port" 2>/dev/null | head -1 || true) if [[ -n "$pid" ]]; then