Commit Graph

15 Commits

Author SHA1 Message Date
study-tool 53bddbabaa docs: 按 json 驱动的插件方案更新 pugin.md
确定 pugin.json 为唯一权威:加载器读 json 注册,main.py 只提供函数;补加载器流程、schema 校验规则、迁移待办。
2026-10-31 14:51:42 +08:00
study-tool a6aa6a88f9 docs: 沉淀插件目录方案与开发流程(docs/pugin.md) 2026-10-31 14:43:15 +08:00
study-tool 7259ab8d96 refactor(platforms): 学习流程下沉到平台层,engine 只保留编排
SessionExpired 移到 platforms/errors.py;旧版流程(_study_builtin)搬到 jspx.py,新版 SPA 流程(run_study_course + 视频)搬到 study.py;engine.py 只剩账号级编排,不再 import 具体平台;routes/quiz 去掉平台 star import,session/dump_cookies 缺失时明确报错。顺带修复学习链路三处未定义全局名(jspx/study/quiz)。
2026-10-31 14:21:36 +08:00
study-tool d702830470 feat(platforms): 增加能力推导与 /api/platforms capabilities 字段
新增 platforms/contract.py:生命周期 ↔ 槽位 ↔ 能力名映射,capabilities_of 按非空槽位推导;Platform.capabilities() 供 /api/platforms 返回 capabilities。行为不变,现有流程与前端未改。同步 architecture.md(生命周期与能力、广东公需课)、todo 第二/三步、OPTIMIZATION 平台列表。
2026-10-31 13:54:28 +08:00
study-tool 0e2923e675 fix: 重新登录后清掉上一轮已结束的运行状态
- 服务重启留下的「已中断」状态会在登录后继续压着卡片徽标、挂着旧进度和红条
- 登录成功后清掉该账号已结束的运行状态(内存 + run_state 表),正在跑的不动,内存日志保留
- 新增 store.run_state_delete(),/api/run 轮询随即把 run 置空,徽标回到「已登录」
2026-10-31 01:00:57 +08:00
study-tool e6515fe278 fix: 运行状态与日志三处修复;依赖改用 uv 锁 + 国内镜像
- 重启标记不再污染新一轮运行:hydrate_runs() 标记「已中断」后立即落库,runtime.set_state() 在切入 discovering/studying 时清掉上一轮的 error/progress/finished_at
- 服务重启后卡片「课程日志」能读到 SQLite 历史:前端兜底条件不再拿 status 是否为空做判断(重启后 status 恒为 interrupted)
- 删除账号连带清日志:account_delete() 按账号 id + 用户名清 run_state/run_log/login_log,删除接口同时清内存里两个 key
- 新增 uv.lock 依赖锁定;pyproject 走阿里云 PyPI 镜像,Dockerfile 支持 PIP_INDEX_URL 构建参数
- 文档移入 docs/,.gitignore 忽略 *.egg-info/(uv run 可编辑安装产物)
2026-10-31 00:53:40 +08:00
study-tool c4bc97dd70 feat(gdgxk): 课程卡片显示培训年度 / 学时 / 完成状态
- list_courses 解析 showCourse 卡片里的「培训年度」「课程学时」「未完成/已完成」,
  返回 section / info / status_label,前端拼成「2026年公需课 · 未完成 · 30 学时」
- 修正完成判定:以平台状态为准(需所有教学活动 100% + 试卷考核 ≥60),
  不再用视频秒数够不够来推断,避免把未完成的课当已学完跳过
2026-10-30 22:33:46 +08:00
study-tool 31f7020190 fix(gdgxk): 打通登录全链路(图形验证码 OCR + 正确换票入口)
- 登录要过 4 位图形验证码:readCaptcha 返回 data:image/png;base64,用 ddddocr 识别,
  失败按登录页 #errorText 判断原因并最多重试 5 次
- 换票入口纠正:票按 ITLMS-xxx||ticketId 两段 GET /nts/loginToStoreByAccount,
  之前直接带 ?ticket= 访问 courseRegister 是无效的
- requirements / pyproject 增加 ddddocr;文档同步实测结论
2026-10-30 22:30:32 +08:00
study-tool 16346159c2 feat: 接入广东公需课平台(jsglpt 登录 + jsxx 进度心跳)
- 新增 platforms/gdgxk.py:base64 登录 → ssoItlmsGxkTicket 换票进 jsxx →
  /uc/store/courseRegister 取课程 → updateViewTime1 心跳上报进度(无需真播)
- platforms/__init__.py 注册;配套抓包脚本与自测脚本
- CHANGELOG / OPTIMIZATION / todo 同步,版本升到 0.0.2
2026-10-30 22:17:47 +08:00
study-tool 1a3347f7f9 feat: 添加账号支持选择学习平台
账号新增 platform 字段,登录/刷新课程/发现课程按平台分发;同时把 JS 脚本收进 script/(目录规范调整)。
2026-10-30 01:13:47 +08:00
study-tool e8634a6317 refactor: React 前端重构,新旧平台合并为莞易学 2026-10-29 23:53:17 +08:00
study-tool 35853891c9 fix: 页面标题改为莞易学,容器内固定国内 DNS
- static/index.html:标题与页头 h1 由「多账号学习控制台」改为「莞易学」
- docker-compose.yml:容器固定 223.5.5.5 / 119.29.29.29,绕过宿主机不可用的 1.1.1.1 上游
2026-10-28 20:41:44 +08:00
study-tool 549a91af1d fix: 首次进入课程自动同步加入(syncSelf)
首次进入课程时课时树回 code=500「你还没有加入学习…」,前端把它渲染成挡路弹层,
人工点掉后 SPA 自己补发 syncSelf 才落库 —— 所以第二次进同一门课就正常。

- discover_study 返回值补 course_code(trainCourse/getById.courseCode)
- 新增 study_mod_get:/mod/* 只带 cookie + Referer,不带 Bearer
- 新增 study_sync_self:GET /mod/school/wanpeng/syncSelf?courseCode=…
- 新增 study_sync_identity:GET /mod/gjt/roleList 补一刀身份
- ensure_study_join 改为:已加入 → student/join → syncSelf + 轮询 getById → 刷新 jspx 页
- todo.md 收尾,新增 OPTIMIZATION.md 记录待实测确认项
2026-10-28 20:41:44 +08:00
study-tool ba23888771 docs: add CHANGELOG and metadata for v0.0.1 2026-10-27 22:36:04 +08:00
study-tool 585a7a28dd feat: study modes (fast/parallel) and course-container completion fix
- settings: study.mode fast|normal and study.parallel 1-5

- normal mode: one headless browser per video, visibility keep-alive, auto-degrade when the platform enforces order

- report study/log/detail/save before isComplete; drop lastProgressTime on completion

- complete periodType 10/13 container nodes and recompute counters via PUT calFinalScore

- capture mode: POST /api/capture records all XHR/fetch including new tabs

- UI: study mode in settings, capture / stop-capture menu items
2026-10-27 22:30:57 +08:00