diff --git a/docs/qx-rewrite-lessons.md b/docs/qx-rewrite-lessons.md index 7134586..58c8c03 100644 --- a/docs/qx-rewrite-lessons.md +++ b/docs/qx-rewrite-lessons.md @@ -35,7 +35,7 @@ hostname = h5.if.qidian.com 6. uid 识别优先级: - `QDHeader` 第一段是有效数字 uid 时优先使用; - 响应体里递归查找 `UserId` / `userId` / `uid`; - - 若 `QDHeader` 第一段是 `(null)`,回退到 Cookie 里的 `ywguid` / `gwguid` / `guid`,避免通知标题显示 `uid:null`。 + - 若 `QDHeader` 第一段是 `(null)`,回退到 Cookie 里的 `ywguid` / `gwguid` / `guid`,仅用于确认账号已识别,不在通知标题显示 uid。 - 只读请求头 Cookie:`script-request-header` 即可; - 需要读取响应 body 辅助解析 uid:用 `script-response-body`。 QDReader 当前需要兼容从响应 body 取 `UserId`,所以使用 `script-response-body`。 diff --git a/js/qdreader_cookie.js b/js/qdreader_cookie.js index 8d2f304..5e615fb 100644 --- a/js/qdreader_cookie.js +++ b/js/qdreader_cookie.js @@ -4,7 +4,7 @@ * * 抓取:打开起点读书 App → 我的 → 福利中心。 * 抓到后会: - * 1. 解析 uid 用于弹窗标题 + * 1. 解析 uid 用于确认账号已识别 * 2. 通知/弹窗里展示完整快速登录命令 + CK,便于直接复制 */ @@ -87,7 +87,7 @@ if (!cookie) { // 发给 Autman 机器人的完整快速登录命令。Autman 插件保留“启点ck ”快速提交通道。 const submitText = `启点ck ${cookie}` const msg = submitText - notify('启点读书', `抓取成功 uid:${uid}`, msg) + notify('启点读书', '抓取成功', msg) $done({}) } } diff --git a/tests/qdreader_cookie.test.mjs b/tests/qdreader_cookie.test.mjs index 2476ffe..cbc12a2 100644 --- a/tests/qdreader_cookie.test.mjs +++ b/tests/qdreader_cookie.test.mjs @@ -23,7 +23,7 @@ function run({ cookie = '', body = '' }) { { const qdheader = Buffer.from('123456|device|more').toString('base64').replace(/=+$/, ''); const notices = run({ cookie: `QDHeader=${encodeURIComponent(qdheader)}; QDH=abc` }); - assert.equal(notices[0][1], '抓取成功 uid:123456'); + assert.equal(notices[0][1], '抓取成功'); assert.match(notices[0][2], /^启点ck /); assert.equal(notices[0].length, 3); } @@ -33,7 +33,7 @@ function run({ cookie = '', body = '' }) { cookie: 'cmfuToken=abc; QDH=def', body: JSON.stringify({ Data: { UserId: 987654 } }), }); - assert.equal(notices[0][1], '抓取成功 uid:987654'); + assert.equal(notices[0][1], '抓取成功'); } { @@ -41,13 +41,13 @@ function run({ cookie = '', body = '' }) { cookie: 'cmfuToken=abc; QDH=def', body: JSON.stringify({ Data: { UserInfo: { UserId: 24680 } } }), }); - assert.equal(notices[0][1], '抓取成功 uid:24680'); + assert.equal(notices[0][1], '抓取成功'); } { const qdheader = Buffer.from('(null)|(null)|1179|2556|(null)|16.10|0|iOS/iPhone/(null)|0|(null)|(null)|475700975|1779006621000|0|(null)|||(null)|(null)|0').toString('base64').replace(/=+$/, ''); const notices = run({ cookie: `QDHeader=${qdheader}; ywguid=120098575768; QDH=abc` }); - assert.equal(notices[0][1], '抓取成功 uid:120098575768'); + assert.equal(notices[0][1], '抓取成功'); } {