阶段0:登录态心跳 + 状态持久化(重构地基)

- 新增 state_store.py:SQLite 状态存储(site_status 表:登录态/数据态/时间戳),
  UPSERT 保留字段,重启不丢
- paths.py:加 STATE_DB_PATH(state/state.db)
- main_router:提取 probe_site_login / probe_data_file;菜单循环改为
  input 后台线程 + 主线程心跳轮询(满足 Playwright sync 线程安全);
  每 30s 探测各站登录态 + 数据文件写库,登录态变化时提示;新增菜单 [12] 站点状态盘
- .gitignore:忽略 state/

为后续 FastAPI 化与 Web 前端提供状态地基。

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Misaka
2026-07-16 22:44:15 +08:00
parent 5030e5b89b
commit a5ceb42ac1
4 changed files with 293 additions and 1 deletions

1
.gitignore vendored
View File

@@ -41,6 +41,7 @@ desktop.ini
# Project specific
downloads/
output/
state/
*.xlsx
*.xls
*.log