fix: hide qdreader uid in notification title

This commit is contained in:
2026-05-17 16:38:59 +08:00
parent 3ad87d2783
commit a079b5249e
3 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -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`
+2 -2
View File
@@ -4,7 +4,7 @@
*
* 抓取:打开起点读书 App → 我的 → 福利中心。
* 抓到后会:
* 1. 解析 uid 用于弹窗标题
* 1. 解析 uid 用于确认账号已识别
* 2. 通知/弹窗里展示完整快速登录命令 + CK,便于直接复制
*/
@@ -87,7 +87,7 @@ if (!cookie) {
// 发给 Autman 机器人的完整快速登录命令。Autman 插件保留“启点ck <cookie>”快速提交通道。
const submitText = `启点ck ${cookie}`
const msg = submitText
notify('启点读书', `抓取成功 uid:${uid}`, msg)
notify('启点读书', '抓取成功', msg)
$done({})
}
}
+4 -4
View File
@@ -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], '抓取成功');
}
{