fix: prompt remark after qdreader quick submit
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
//[author: Hermes]
|
||||
//[service: BOSS]
|
||||
//[class: 工具类]
|
||||
//[version: 2.3.4]
|
||||
//[version: 2.3.5]
|
||||
//[platform: web,qq,wx,tg,tb,fs,we]
|
||||
//[public: false]
|
||||
//[price: 0]
|
||||
@@ -187,7 +187,7 @@ function contentText() {
|
||||
}
|
||||
function usage() {
|
||||
return [
|
||||
"启点读书签到插件 v2.3.4",
|
||||
"启点读书签到插件 v2.3.5",
|
||||
"【一级菜单】",
|
||||
"账号管理:启点账号",
|
||||
"执行查询:启点查询",
|
||||
@@ -640,6 +640,13 @@ function main() {
|
||||
if (cmd === "ck" && /^(查询|状态|status|list|账号|管理)$/i.test(arg)) { reply("请使用一级菜单:启点账号 或 启点查询;快速提交CK:启点ck <cookie>"); return }
|
||||
var delMsg = handleDelete(arg, store, bind)
|
||||
if (delMsg !== null) { reply(delMsg); return }
|
||||
if (cmd === "ck") {
|
||||
var saveUid = extractUid(arg)
|
||||
var saveMsg = handleSaveCookie(arg, store, bind)
|
||||
if (/成功|未变化/.test(saveMsg) && saveUid) saveMsg += maybePromptRemark(saveUid)
|
||||
reply(saveMsg)
|
||||
return
|
||||
}
|
||||
reply(handleSaveCookie(arg, store, bind))
|
||||
}
|
||||
main()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
//[author: Hermes]
|
||||
//[service: BOSS]
|
||||
//[class: 工具类]
|
||||
//[version: 2.3.4]
|
||||
//[version: 2.3.5]
|
||||
//[platform: web,qq,wx,tg,tb,fs,we]
|
||||
//[public: false]
|
||||
//[price: 0]
|
||||
@@ -187,7 +187,7 @@ function contentText() {
|
||||
}
|
||||
function usage() {
|
||||
return [
|
||||
"启点读书签到插件 v2.3.4",
|
||||
"启点读书签到插件 v2.3.5",
|
||||
"【一级菜单】",
|
||||
"账号管理:启点账号",
|
||||
"执行查询:启点查询",
|
||||
@@ -640,6 +640,13 @@ function main() {
|
||||
if (cmd === "ck" && /^(查询|状态|status|list|账号|管理)$/i.test(arg)) { reply("请使用一级菜单:启点账号 或 启点查询;快速提交CK:启点ck <cookie>"); return }
|
||||
var delMsg = handleDelete(arg, store, bind)
|
||||
if (delMsg !== null) { reply(delMsg); return }
|
||||
if (cmd === "ck") {
|
||||
var saveUid = extractUid(arg)
|
||||
var saveMsg = handleSaveCookie(arg, store, bind)
|
||||
if (/成功|未变化/.test(saveMsg) && saveUid) saveMsg += maybePromptRemark(saveUid)
|
||||
reply(saveMsg)
|
||||
return
|
||||
}
|
||||
reply(handleSaveCookie(arg, store, bind))
|
||||
}
|
||||
main()
|
||||
|
||||
@@ -91,6 +91,13 @@ test('manual cookie save falls back to QDHeader embedded UserId before ywguid',
|
||||
assert.equal(JSON.parse(r.store.qdreader_cookie_json)['475700975'], streamCookie);
|
||||
});
|
||||
|
||||
test('quick submit prompts remark after saving cookie', () => {
|
||||
const r = runPlugin({ content: '启点ck ' + cookie, userId: 'user-a', listens: ['主号'] });
|
||||
assert.match(r.replies.join('\n'), /是否为该账号添加备注/);
|
||||
assert.match(r.replies.join('\n'), /备注: 主号/);
|
||||
assert.equal(JSON.parse(r.store.qdreader_remark_json)['12345'], '主号');
|
||||
});
|
||||
|
||||
test('manual sign and cron sign both call sign gateway then qidian checkin', () => {
|
||||
const store = {
|
||||
qdreader_cookie_json: JSON.stringify({ '12345': cookie }),
|
||||
|
||||
Reference in New Issue
Block a user