Repository navigation
feat(meoo): 新增 Meoo 秒悟网页会话线——每日首登积分自动领取 + 积分余额 - #63
Merged
Merged
Conversation
- 新增 src/meooClient.js:
- 签到 = 调网页端同款 GET /api/mc/entitlement/init 触发每日首次登录积分发放
(dailyLoginGranted → checked-in +N;已初始化无发放 → already;
initialized=false 按前端同款退避重查,仍未就绪记 failed 下轮重试)
- 会话失效(HTTP 401 / errCode NEED_LOGIN|LOGIN_INVALID / user/me need_login)
统一记 failed 并提示到「网页会话」页重新登录捕获,不重试、不猜
- 余额 = /api/mc/entitlement/get 的 userPointInfo.account.availableBalance,
activeGrants 有则逐笔出 parts(来源 / 剩余 / 到期日)
- 身份 = /api/v1/user/me 的 user_id(多号归户,展示前3后3脱敏)
- cookieSites 登记 meoo 站点(verify:'api',cookieUrls meoo.com,no10rSync)
- constants / providers / checkin 单位 / daemon(捕获、就地重探、quota 单位、
todayByProduct 日界)/ panel(网页会话卡「立即签到」+ 积分余额胶囊)接线
- 捕获与重探只读,不调 init;发放动作只走签到线
- i18n 四语词条、README 站点表、package.json description、release-check 别名
- 新增 test/meoo.test.js(12 例,mock fetch)
Owner
|
审查通过,实现质量很高,几处确认点说明: 已验证
两个小问题(不阻塞合并,可后续跟进)
好活,merge。💪 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
做了什么
新增 Meoo 秒悟(meoo.com,阿里云) 网页会话线:每日首登积分自动领取 + 积分余额展示。按 WPS 灵犀(#53)的接入方式接线,改动保持最小。
为什么
Meoo 每天首次登录网页端会发放首登积分(当前 2000/天,约 6~7 天后过期;Free 套餐没有月度积分),不登录就领不到。发放是网页前端登录后调用
GET /api/mc/entitlement/init触发的,用会话 cookie 就能每天代调一次,不需要人工打开网页。怎么做的
src/meooClient.js(新增)checkinMeoo:调GET /api/mc/entitlement/init(带 meoo.com 会话 cookie)。dailyLoginGranted=true且金额 > 0 →checked-in(+N 积分)。already(多为当天网页端已登录过)。initialized=false→ 按前端同款退避重查(500/1000/2000ms),仍未就绪记failed,下一轮签到会自动重试。NEED_LOGIN/LOGIN_INVALID、user/me返回need_login=true,都按「会话已失效,请到『网页会话』页重新登录 meoo.com 并捕获」处理。签到线记failed(带authExpired),不抛异常,也不重试、不猜。fetchMeooQuota:余额取GET /api/mc/entitlement/get的userPointInfo.account.availableBalance。有activeGrants时逐笔列出 parts(来源 DAILY_LOGIN / INVITE_REWARD / SUBSCRIPTION、剩余、到期日),没有时显示单行余额。GET /api/v1/user/me的user_id,用于多号归户;行名按前 3 后 3 脱敏(与灵犀 uid 同口径)。username/email可能是手机号,不读取、不落盘。cookieSites.js:登记meoo站点(loginUrlhttps://meoo.com、`cookieUrls` meoo.com、verify:'api'、no10rSync:true,首版不推 10Router 卡)。constants(PROVIDERS / 标签 / productOf)、providers(checkin + quota)、checkin.js领取日志单位。daemon.js:秒悟积分:独立口径,不计入剩余积分合计。todayByProduct.meoo:0 点翻日。no10rSync站点不进重探推卡名单,/api/cookie-sites回显no10rSync。panel.html:网页会话卡加「立即签到」(FREE_CHECKIN_SITES),显示积分余额胶囊和最早到期日。init;发放动作只在签到线上执行。check-i18n通过)、README 站点表与目录、package.jsondescription、release-check别名。凭据说明
/api/mc/*带 Bearer 一律返回NEED_LOGIN。测试
test/meoo.test.js,12 例,用 mock fetch,覆盖:NEED_LOGIN两种失效形态、无 cookienode --test全量 454 例:446 pass / 0 fail / 8 skip(Node 22 与 Node 24 各跑一遍)。node scripts/check-i18n.js全部覆盖。NEED_LOGIN,处理正确。