feat: 每日积分改以平台积分台账为准
- 新增 points-platform:读取 /ssp/#/my/point 背后的 rule/org 与 point/history/self - 整门课完成不再直接 +3,等平台真的入账后按 nameType 归类计数 - 平台今日学习积分达到上限,或连续 3 门确有学习内容却未入账时收尾 - 接口不可用(未登录/跨域/网络)时退回本地计数,面板额外显示平台台账 - 新增离线回归测试与只读探测脚本 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
f41fc72fe2
commit
18c5e5a3be
15 files changed
+1042
-141
No files matched your search
+9
-2
@@ -2,6 +2,7 @@
|
||||
import { VERSION, LS_ENABLED, LS_PREFER_SHORT, SS_SHORT_CATALOG, PANEL_ID, TAG } from './config.js';
|
||||
import { R, S, state, points, saveRunState } from './state.js';
|
||||
import { LS_POINTS_MODE } from './points.js';
|
||||
import { cachedPlatformPoints } from './points-platform.js';
|
||||
import { route } from './route.js';
|
||||
import { isLoginPage, startBatch, doLoginAndStart, clearSavedCreds } from './login.js';
|
||||
|
||||
@@ -44,6 +45,12 @@ export function setStatus(text) {
|
||||
if (statusEl) statusEl.textContent = text;
|
||||
}
|
||||
|
||||
// 面板上再带一份平台台账的真实今日积分,避免本地未归类的记录让数字偏小
|
||||
function platformSuffix() {
|
||||
const p = cachedPlatformPoints();
|
||||
return p && p.ok ? ' · 平台 ' + p.todayPoints + '/' + p.maxPoints : '';
|
||||
}
|
||||
|
||||
export function updatePanel() {
|
||||
if (cbBatch) cbBatch.checked = S.batchRunning;
|
||||
if (statsEl) {
|
||||
@@ -64,7 +71,7 @@ export function updatePanel() {
|
||||
if (cbPoints) cbPoints.checked = state.pointsEnabled;
|
||||
if (pointsEl) {
|
||||
pointsEl.style.display = state.pointsEnabled ? 'block' : 'none';
|
||||
pointsEl.textContent = state.pointsEnabled ? points.summary() : '';
|
||||
pointsEl.textContent = state.pointsEnabled ? points.summary() + platformSuffix() : '';
|
||||
}
|
||||
|
||||
const onLogin = isLoginPage();
|
||||
@@ -271,7 +278,7 @@ export function buildPanel() {
|
||||
cbPoints.type = 'checkbox';
|
||||
cbPoints.id = 'yun-xue-tang-points-enabled';
|
||||
cbPoints.checked = state.pointsEnabled;
|
||||
cbPoints.title = '按课时类型计分:文档1 / 视频3 / 音频2 / 微课2,每天最多 24 分';
|
||||
cbPoints.title = '整门课完成计 1 次:文档1 / 视频3 / 音频2 / 微课2,每天最多 24 分';
|
||||
cbPoints.addEventListener('change', function () {
|
||||
state.pointsEnabled = cbPoints.checked;
|
||||
points.setEnabled(state.pointsEnabled);
|
||||
|
||||
Reference in new issue
Block a user