refactor: 重构为可部署到服务器的模块化结构(v5.0.0)
- 拆包 fengxiang/:config/client/store/notify/monitor/admin/tts,统一入口 order_monitor.py - 服务器形态:Docker 常驻,Cookie 由本机登录后 POST 上传并热加载,不再依赖桌面弹窗 - 修复:首次启动重推历史订单、speak() 阻塞主循环、夜间 sleep 10h 不可中断 - 修复:test_push.py 残留 miservice 依赖(小爱已移除)、run_monitor.bat 写死盘符 - 配置化:webhook/shopId 移出源码(环境变量 > config.yaml > 默认值) - 可观测:滚动文件日志 + /healthz + Docker HEALTHCHECK + 告警冷却 - 飞书通道保留配置位,默认关闭(原 token 已失效 code=19001) - 新增 22 项单元测试(不联网)
This commit is contained in:
1 parent
ab6a2bb7ea
commit
4ee30399bf
30 files changed
+2410
-825
No files matched your search
@@ -0,0 +1,39 @@
|
||||
@echo off
|
||||
chcp 65001 >nul
|
||||
title 丰享登录并同步 Cookie
|
||||
cd /d "%~dp0"
|
||||
|
||||
echo ============================================
|
||||
echo 登录丰享商家端,并把 Cookie 同步到服务器
|
||||
echo ============================================
|
||||
echo.
|
||||
|
||||
set "PYTHON="
|
||||
if exist ".venv\Scripts\python.exe" set "PYTHON=.venv\Scripts\python.exe"
|
||||
if not defined PYTHON if defined FX_PYTHON set "PYTHON=%FX_PYTHON%"
|
||||
if not defined PYTHON set "PYTHON=python"
|
||||
|
||||
"%PYTHON%" -c "import playwright" >nul 2>&1
|
||||
if errorlevel 1 (
|
||||
echo [准备] 安装 Playwright...
|
||||
"%PYTHON%" -m pip install -r requirements-local.txt
|
||||
"%PYTHON%" -m playwright install chromium
|
||||
)
|
||||
|
||||
:: 服务器地址与 token:优先用环境变量,也可直接改下面两行
|
||||
if not defined FX_SERVER set "FX_SERVER=http://192.168.8.210:52100"
|
||||
if not defined FX_ADMIN_TOKEN (
|
||||
echo [错误] 请先设置管理接口 token,例如:
|
||||
echo set FX_ADMIN_TOKEN=你的token
|
||||
echo token 与服务器 config.yaml 里 admin.token 一致
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo [1/2] 打开浏览器登录丰享...
|
||||
echo.
|
||||
"%PYTHON%" fengxiang_scraper.py --upload --server "%FX_SERVER%"
|
||||
|
||||
echo.
|
||||
echo [2/2] 完成。若提示上传失败,请检查服务器地址/token。
|
||||
pause
|
||||
Reference in new issue
Block a user