feat: V1.1 批次入库——色号表SEO页/Showcase/图纸库/帮助中心/JSON-LD/CI门禁/竞品分析

This commit is contained in:
Sisyphus committed 2026-08-15 14:41:00 +08:00
1 parent 40e2342a02
commit f53f0a2b25
104 files changed
+21760 -157

No files matched your search

+42 -36
View File
@@ -1,79 +1,85 @@
@echo off
chcp 65001 >nul
title PERLER LAB 开发环境
title PERLER LAB Dev Environment
setlocal
rem ============================================================
rem PERLER LAB 一键开发启动脚本
rem 1. 检查 Node.js / npm 环境
rem 2. 启动后端 (perler-lab-server, 端口 8788)
rem 3. 启动前端 (perler-lab, Vite 端口 5173)
rem 4. 打印访问地址与健康检查命令
rem PERLER LAB one-click development startup script
rem 1. Check Node.js / npm environment
rem 2. Start backend (perler-lab-server, port 8788)
rem 3. Start frontend (perler-lab, Vite port 5173)
rem 4. Print access URLs and health check command
rem
rem NOTE (BUG-087): this file is intentionally pure ASCII and
rem resolves the project directory via %~dp0, so it runs correctly
rem under any console codepage (including GBK/cp936) without
rem relying on chcp or UTF-8 BOM handling.
rem ============================================================
echo ==========================================
echo PERLER LAB 开发环境启动中...
echo PERLER LAB Dev Environment is starting...
echo ==========================================
echo.
rem ---------- 1. 检查 Node.js / npm 是否可用 ----------
rem ---------- 1. Check Node.js / npm availability ----------
where node >nul 2>nul
if errorlevel 1 (
echo [错误] 未检测到 Node.js,请先安装 Node.js 20 或更高版本。
echo 下载地址: https://nodejs.org/
echo 安装完成后重新运行本脚本。
echo [ERROR] Node.js not found. Please install Node.js 20 or later.
echo Download: https://nodejs.org/
echo Re-run this script after installation.
pause
exit /b 1
)
where npm >nul 2>nul
if errorlevel 1 (
echo [错误] 未检测到 npm,请检查 Node.js 安装是否完整。
echo [ERROR] npm not found. Please check your Node.js installation.
pause
exit /b 1
)
for /f "delims=" %%V in ('node --version') do set "NODE_VERSION=%%V"
echo [信息] Node.js 版本: %NODE_VERSION%
echo [INFO] Node.js version: %NODE_VERSION%
rem ---------- 2. 检查端口是否已被占用(仅警告,不中断) ----------
rem ---------- 2. Check port usage (warning only, non-blocking) ----------
netstat -ano | findstr ":8788 " | findstr "LISTENING" >nul 2>nul
if not errorlevel 1 (
echo [警告] 端口 8788 已被占用!后端可能已在运行,或端口被其他程序使用。
echo 可先执行 stop-dev.bat 停止旧进程后再启动。
echo [WARNING] Port 8788 is already in use! The backend may already be running.
echo Run stop-dev.bat first to stop old processes.
)
netstat -ano | findstr ":5173 " | findstr "LISTENING" >nul 2>nul
if not errorlevel 1 (
echo [警告] 端口 5173 已被占用!前端可能已在运行,或端口被其他程序使用。
echo 可先执行 stop-dev.bat 停止旧进程后再启动。
echo [WARNING] Port 5173 is already in use! The frontend may already be running.
echo Run stop-dev.bat first to stop old processes.
)
echo.
rem ---------- 3. 启动后端(独立最小化窗口) ----------
echo [启动] 正在启动后端服务 http://localhost:8788 ...
start "PERLER LAB 后端" /min cmd /c "cd /d D:\拼豆\perler-lab-server && npx tsx src/server.ts"
rem ---------- 3. Start backend (separate minimized window) ----------
echo [START] Starting backend service http://localhost:8788 ...
start "PERLER LAB Backend" /min cmd /c "cd /d ""%~dp0perler-lab-server"" && npx tsx src/server.ts"
rem ---------- 4. 等待 3 秒让后端完成启动 ----------
timeout /t 3 /nobreak >nul
rem ---------- 4. Wait 3 seconds for the backend to boot ----------
rem ping is used instead of timeout because timeout fails when stdin is
rem redirected (e.g. when run via "cmd /c ... < nul" in scripts/CI).
ping -n 4 127.0.0.1 >nul
rem ---------- 5. 启动前端(独立最小化窗口) ----------
echo [启动] 正在启动前端开发服务器 http://localhost:5173 ...
start "PERLER LAB 前端" /min cmd /c "cd /d D:\拼豆\perler-lab && npm run dev"
rem ---------- 5. Start frontend (separate minimized window) ----------
echo [START] Starting frontend dev server http://localhost:5173 ...
start "PERLER LAB Frontend" /min cmd /c "cd /d ""%~dp0perler-lab"" && npm run dev"
rem ---------- 6. 打印访问信息 ----------
rem ---------- 6. Print access info ----------
echo.
echo ==========================================
echo PERLER LAB 开发环境已启动!
echo PERLER LAB Dev Environment is running!
echo ------------------------------------------
echo 前端页面: http://localhost:5173
echo 后端接口: http://localhost:8788
echo 健康检查: curl http://localhost:8788/health
echo Frontend: http://localhost:5173
echo Backend: http://localhost:8788
echo Health: curl http://localhost:8788/health
echo ------------------------------------------
echo 提示: 后端/前端分别运行在独立的最小化窗口中,
echo 查看日志请点击任务栏对应窗口标题。
echo 停止服务请运行 stop-dev.bat
echo Note: backend/frontend run in separate minimized windows;
echo check logs by clicking the corresponding window title.
echo Stop services by running stop-dev.bat
echo ==========================================
echo.
rem 直接双击运行时保留窗口查看信息
rem Keep the window open when double-clicked
pause