fix: fallback qdreader uid to cookie guid

This commit is contained in:
2026-05-17 16:47:16 +08:00
parent 2a7a4fea91
commit 11530c342d
4 changed files with 37 additions and 11 deletions
+8
View File
@@ -65,6 +65,14 @@ test('manual cookie save masks cookie and stores by uid', () => {
assert.equal(JSON.parse(r.bucketStore['hermes_qidian.qdreader_user_bind_json'])['12345'], 'user-a');
});
test('manual cookie save falls back to ywguid when QDHeader uid is null', () => {
const fallbackCookie = 'QDHeader=KG51bGwpfHg=; ywguid=54321; qdh=qdh; sessionyw=s; appId=10';
const r = runPlugin({ content: '启点ck ' + fallbackCookie });
assert.match(r.replies.join('\n'), /CK新增成功/);
assert.match(r.replies.join('\n'), /uid: 54321/);
assert.equal(JSON.parse(r.store.qdreader_cookie_json)['54321'], fallbackCookie);
});
test('manual sign and cron sign both call sign gateway then qidian checkin', () => {
const store = { qdreader_cookie_json: JSON.stringify({ '12345': cookie }) };
const manual = runPlugin({ content: '启点签到', store: { ...store } });