fix: emit qdreader ck as upstream json map

This commit is contained in:
2026-05-17 17:57:59 +08:00
parent 336beb79d6
commit 63ab824f68
4 changed files with 14 additions and 10 deletions
+2 -1
View File
@@ -34,7 +34,7 @@ hostname = h5.if.qidian.com
4. QX 弹窗正文只显示:
```text
启点ck <完整 Cookie>
启点ck {"<uid>":"<完整 Cookie>"}
```
5. 复制整段发给 Autman 机器人。
@@ -58,6 +58,7 @@ https://gitea.chickliu.fun/Hermes/autman-plugins/raw/branch/main/js/qdreader_sig
主要命令:
```text
启点ck {"<uid>":"<cookie>"}
启点ck <cookie>
启点账号
启点查询
+2 -2
View File
@@ -24,10 +24,10 @@ hostname = h5.if.qidian.com
1. QX 只负责抓取 Cookie,不直接调用 Autman。
2. 不在 QX 本地持久化 Cookie;账号保存交给 Autman 插件。
3. 弹窗正文只保留完整快速提交命令;通知不附加跳转动作,避免点击通知时直接运行快捷指令,影响进入通知详情复制。
3. 弹窗正文只保留完整快速提交命令,格式优先保持原项目数据形态 `{"uid":"cookie"}`;通知不附加跳转动作,避免点击通知时直接运行快捷指令,影响进入通知详情复制。
```text
启点ck <完整 Cookie>
启点ck {"<uid>":"<完整 Cookie>"}
```
4. 不要在弹窗正文加说明、账号数、变量名、截断摘要;BOSS 要直接复制整段命令。
+3 -3
View File
@@ -5,7 +5,7 @@
* 抓取:打开起点读书 App → 我的 → 福利中心。
* 抓到后会:
* 1. 解析 uid 用于确认账号已识别
* 2. 通知/弹窗里展示完整快速登录命令 + CK,便于直接复制
* 2. 通知/弹窗里展示原项目风格 JSON Map 快速登录命令,便于直接复制
*/
function getHeader(headers, name) {
@@ -90,8 +90,8 @@ if (!cookie) {
notify('启点读书', 'Cookie 获取失败', '无法识别 uid,请确认已登录并进入福利中心')
$done({})
} else {
// 发给 Autman 机器人的完整快速登录命令。Autman 插件保留“启点ck <cookie>”快速提交通道
const submitText = `启点ck ${cookie}`
// 发给 Autman 机器人的完整快速登录命令,保持原项目 {"uid":"cookie"} 数据格式
const submitText = `启点ck ${JSON.stringify({ [uid]: cookie })}`
const msg = submitText
notify('启点读书', '抓取成功', msg)
$done({})
+7 -4
View File
@@ -23,9 +23,12 @@ function run({ cookie = '', body = '', headerName = 'Cookie' }) {
{
const qdheader = Buffer.from('123456|device|more').toString('base64').replace(/=+$/, '');
const { notices } = run({ cookie: `QDHeader=${encodeURIComponent(qdheader)}; QDH=abc` });
const cookie = `QDHeader=${encodeURIComponent(qdheader)}; QDH=abc`;
const { notices } = run({ cookie });
assert.equal(notices[0][1], '抓取成功');
assert.match(notices[0][2], /^启点ck /);
const body = notices[0][2];
assert.match(body, /^启点ck /);
assert.deepEqual(JSON.parse(body.replace(/^启点ck\s+/, '')), { '123456': cookie });
assert.equal(notices[0].length, 3);
}
@@ -58,7 +61,7 @@ function run({ cookie = '', body = '', headerName = 'Cookie' }) {
body: JSON.stringify({ Data: { Guid: '120098575768', UserId: '475700975' }, Result: '0' }),
});
assert.equal(notices[0][1], '抓取成功');
assert.match(notices[0][2], /^启点ck /);
assert.deepEqual(JSON.parse(notices[0][2].replace(/^启点ck\s+/, '')), { '475700975': `QDHeader=${streamQdheader}; ywguid=120098575768; QDH=abc` });
}
{
@@ -69,7 +72,7 @@ function run({ cookie = '', body = '', headerName = 'Cookie' }) {
});
assert.equal(notices[0][0], '启点读书');
assert.equal(notices[0][1], '抓取成功');
assert.equal(notices[0][2], '启点ck cmfuToken=abc; QDH=def');
assert.equal(notices[0][2], '启点ck {"135790":"cmfuToken=abc; QDH=def"}');
assert.equal(notices[0].length, 3);
assert.equal(JSON.stringify(donePayloads[0]), '{}');
}