重构物流客服模块并完善会话接待工作台
- 拆分应用工厂、业务服务与路由,保留原有 HTTP/SSE 和存储入口 - 分离页面资源,重排客服工作台并完善响应式导航、草稿和附件交互 - 整理维护脚本、请求示例和贡献指南,移除启动脚本中的密钥配置 - 上传文件改为仅本地保留,补充隔离的后端与前端回归验证 验证:46 项 Python 测试通过,含 14 个已有子测试;12 个 Node 前端场景通过。
This commit is contained in:
@@ -1,21 +1,46 @@
|
||||
@echo off
|
||||
chcp 936 >nul
|
||||
title Baiyue Logistics AI Customer Service
|
||||
setlocal DisableDelayedExpansion
|
||||
cd /d "%~dp0"
|
||||
|
||||
set "PYTHON_ARGS="
|
||||
if defined VIRTUAL_ENV (
|
||||
set "PYTHON_EXE=%VIRTUAL_ENV%\Scripts\python.exe"
|
||||
call :probe_python
|
||||
if not errorlevel 1 goto python_ready
|
||||
)
|
||||
|
||||
set "PYTHON_EXE=%~dp0.venv\Scripts\python.exe"
|
||||
call :probe_python
|
||||
if not errorlevel 1 goto python_ready
|
||||
|
||||
set "PYTHON_EXE=py.exe"
|
||||
set "PYTHON_ARGS=-3"
|
||||
call :probe_python
|
||||
if not errorlevel 1 goto python_ready
|
||||
|
||||
set "PYTHON_EXE=python.exe"
|
||||
set "PYTHON_ARGS="
|
||||
call :probe_python
|
||||
if not errorlevel 1 goto python_ready
|
||||
|
||||
echo [ERROR] No working Python 3 interpreter found. Install Python or recreate .venv.
|
||||
if /i "%~1"=="--check-python" exit /b 1
|
||||
pause
|
||||
exit /b 1
|
||||
|
||||
:python_ready
|
||||
if /i "%~1"=="--check-python" (
|
||||
"%PYTHON_EXE%" %PYTHON_ARGS% -c "import sys; print(sys.executable)"
|
||||
exit /b
|
||||
)
|
||||
|
||||
chcp 936 >nul
|
||||
title Baiyue Logistics AI Customer Service
|
||||
echo ============================================
|
||||
echo Baiyue Logistics AI Customer Service
|
||||
echo ============================================
|
||||
echo.
|
||||
|
||||
where python >nul 2>nul
|
||||
if errorlevel 1 (
|
||||
echo [ERROR] python not found. Install Python and tick "Add to PATH".
|
||||
echo.
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo [1/3] Checking port 5000 ...
|
||||
netstat -ano | findstr "LISTENING" | findstr /C:":5000 " >nul
|
||||
if not errorlevel 1 (
|
||||
@@ -35,9 +60,10 @@ if not errorlevel 1 (
|
||||
echo OK - port is free.
|
||||
|
||||
echo [2/3] Checking DEEPSEEK_API_KEY ...
|
||||
if "%DEEPSEEK_API_KEY%"=="" (
|
||||
if not defined DEEPSEEK_API_KEY (
|
||||
echo.
|
||||
echo [WARN] DEEPSEEK_API_KEY is empty in this window.
|
||||
echo .env files are not loaded automatically.
|
||||
echo If you just ran setx, reopen this window or restart VS Code.
|
||||
echo setx DEEPSEEK_API_KEY "sk-xxxxxxxx"
|
||||
echo.
|
||||
@@ -47,10 +73,10 @@ if "%DEEPSEEK_API_KEY%"=="" (
|
||||
)
|
||||
|
||||
echo [3/3] Checking dependencies ...
|
||||
python -c "import flask, requests" >nul 2>nul
|
||||
"%PYTHON_EXE%" %PYTHON_ARGS% -c "import flask, requests, waitress" >nul 2>nul
|
||||
if errorlevel 1 (
|
||||
echo Missing packages, installing ...
|
||||
python -m pip install -r requirements.txt
|
||||
"%PYTHON_EXE%" %PYTHON_ARGS% -m pip install -r requirements.txt
|
||||
if errorlevel 1 (
|
||||
echo [ERROR] pip install failed, check network and retry.
|
||||
pause
|
||||
@@ -67,8 +93,15 @@ echo ============================================
|
||||
echo.
|
||||
|
||||
start "" http://127.0.0.1:5000
|
||||
python am.py
|
||||
"%PYTHON_EXE%" %PYTHON_ARGS% am.py
|
||||
set "APP_EXIT_CODE=%ERRORLEVEL%"
|
||||
|
||||
echo.
|
||||
echo Server stopped.
|
||||
pause
|
||||
pause
|
||||
exit /b %APP_EXIT_CODE%
|
||||
|
||||
:probe_python
|
||||
"%PYTHON_EXE%" %PYTHON_ARGS% -c "import sys; sys.exit(0 if sys.version_info.major == 3 else 1)" >nul 2>nul
|
||||
if "%ERRORLEVEL%"=="0" exit /b 0
|
||||
exit /b 1
|
||||
|
||||
Reference in New Issue
Block a user