feat: 故障推送 / 公需课自动重学 / 插件解耦,发版 v0.0.8
体检修复:启动日志不再打印 AUTH_TOKEN、密钥可清空、推送失败不占整段冷却、目录名与文案统一成 plugins/。
This commit is contained in:
@@ -102,7 +102,7 @@ pnpm typecheck
|
||||
| --- | --- |
|
||||
| `accounts` | 账号 / 密码 / 会话 cookie / 课程缓存 / 勾选 / 自动交测验·反馈表开关 |
|
||||
| `settings` | 大模型配置(`base_url` / `api_key` / `model` / 温度 / 超时 / 提示词) |
|
||||
| `kv` | 通用缓存(例如 study 平台试出来的接口前缀、`study_video.py` 的会话) |
|
||||
| `kv` | 通用缓存(例如 study 平台试出来的接口前缀、莞易学 `script/study_video.py` 的会话) |
|
||||
| `login_log` | 每次登录尝试(平台原话,`/api/loginlog` 读它) |
|
||||
| `run_log` | 每个账号的运行日志(`/api/log/history?key=<id>&tail=200`) |
|
||||
| `run_state` | 运行状态快照,进程重启后 `/api/runs` 仍能看到,未跑完的标 `interrupted` |
|
||||
@@ -164,30 +164,26 @@ src/study_tool/
|
||||
app.py 组装:FastAPI、鉴权中间件、页面 / health、启动 main()
|
||||
webapp.py FastAPI 实例(路由模块从这里注册,避免循环导入)
|
||||
runtime.py 运行状态 + 统一日志源(控制台 / 内存 / SQLite)
|
||||
config.py 常量、环境变量、根目录定位(data / static / script)
|
||||
store.py SQLite3:账号 / 设置 / 登录记录 / 运行日志 / 状态 / 缓存 / 快照
|
||||
models.py HTTP 请求模型
|
||||
settings_store.py 系统设置读写
|
||||
llm.py 大模型调用
|
||||
quiz.py 测验解析 / 交卷 / AI 答题
|
||||
config/ 全局路径常量(ROOT / DATA / STATIC_DIR);settings.py 系统设置读写
|
||||
database/ SQLite 存储(SQLAlchemy ORM):models.py + 读写函数
|
||||
models.py 通用 HTTP 请求模型
|
||||
llm/ 大模型调用
|
||||
engine.py 学习引擎:发现 → 按平台分发 → worker / 视频 / 提交
|
||||
capture.py 抓包
|
||||
platforms/ 平台插件
|
||||
platforms/ 平台运行时
|
||||
base.py Platform 契约(id / label / study / entries)
|
||||
registry.py 注册表:register / get / detect / all
|
||||
detect.py 页面代际识别(旧版 / 新版 SPA)
|
||||
guanyixue.py 莞易学:合并 jspx 登录入口与 study 学习入口
|
||||
jspx.py 莞易学旧版页面实现
|
||||
study.py 莞易学新版 SPA 实现
|
||||
plugins/ 平台插件
|
||||
guanyixue/ 莞易学:main.py + config.py(站点常量)+ utils/ + capture.py(抓包)+ quiz.py(测验)
|
||||
routes/ HTTP 接口
|
||||
accounts.py 账号 / 登录 / 登录记录
|
||||
misc.py 课程 / 发现 / 学习 / 停止 / 抓包 / 快照 / 平台列表
|
||||
logs.py /api/log、/api/runs
|
||||
settings.py /api/settings
|
||||
llm.py /api/llm/test
|
||||
web/ 前端源码(React 19 + TypeScript + Vite + Tailwind CSS v4)
|
||||
static/ 前端构建产物(index.html + assets/ + favicon.svg)
|
||||
script/des.js 服务端 DES 加密(登录表单 rsa 字段,站点原版算法)
|
||||
script/desenc.js DES 命令行封装(Node 调用,config.py 里定位)
|
||||
script/reference/ 不参与运行的参考脚本:油猴 dgjy-toolkit.user.js、study-axios.mjs
|
||||
(插件专属脚本在 plugins/<名字>/script/:莞易学的 des.js、desenc.js、study_video.py,公需课的抓包 / 自测脚本)
|
||||
start.bat 一键启动(Windows)
|
||||
Dockerfile Docker 镜像(python:3.12-slim + nodejs + chromium)
|
||||
docker-compose.yml Docker 编排:端口、数据卷、AUTH_TOKEN、健康检查
|
||||
@@ -195,7 +191,6 @@ docker-compose.yml Docker 编排:端口、数据卷、AUTH_TOKEN、健
|
||||
requirements.txt 依赖
|
||||
data/study.db SQLite 库(账号/设置/日志/快照)
|
||||
docs/architecture.md 分层说明 + 平台插件怎么加
|
||||
study_video.py 独立命令行工具:按 trainCourseId 直接刷视频课时(会话也存 study.db)
|
||||
```
|
||||
|
||||
分层与插件契约见 [docs/architecture.md](docs/architecture.md):引擎只按 `course["platform"]`
|
||||
@@ -222,7 +217,7 @@ GET jspx.dgjy.net/admin/main.action table-results 课程表
|
||||
|
||||
新版页面(慕课)另走一条 OAuth 码换 token 的链,拿到 `study.dgjy.net` 的 `Middle-Token`,见 `ensure_study_session()`。
|
||||
`jspx.dgjy.net` 与 `study.dgjy.net` 在注册表里是同一个平台(`guanyixue` / 莞易学),
|
||||
课程发现时自动判断页面代际(旧版 / 新版),分别走 `jspx.py` / `study.py` 的学习实现。
|
||||
课程发现时自动判断页面代际(旧版 / 新版),分别走 `utils/learn.py` / `utils/spa.py` 的学习实现。
|
||||
|
||||
## 接口
|
||||
|
||||
|
||||
Reference in New Issue
Block a user