fix: remove qx copy shortcut action
This commit is contained in:
@@ -24,7 +24,7 @@ hostname = h5.if.qidian.com
|
||||
|
||||
1. QX 只负责抓取 Cookie,不直接调用 Autman。
|
||||
2. 不在 QX 本地持久化 Cookie;账号保存交给 Autman 插件。
|
||||
3. 弹窗正文只保留完整快速提交命令:
|
||||
3. 弹窗正文只保留完整快速提交命令;通知不附加跳转动作,避免点击通知时直接运行快捷指令,影响进入通知详情复制。
|
||||
|
||||
```text
|
||||
启点ck <完整 Cookie>
|
||||
|
||||
@@ -60,14 +60,8 @@ function getUid(cookie, body) {
|
||||
const obj = parseJson(body || '', null)
|
||||
return findUid(obj)
|
||||
}
|
||||
function notify(title, sub, msg, opts) {
|
||||
try { $notify(title, sub || '', msg || '', opts || {}) } catch (e) { $notify(title, sub || '', msg || '') }
|
||||
}
|
||||
function copyAction(command) {
|
||||
return {
|
||||
'open-url': 'shortcuts://run-shortcut?name=Copy&input=text&text=' + encodeURIComponent(command),
|
||||
'media-url': 'data:text/plain;charset=utf-8,' + encodeURIComponent(command)
|
||||
}
|
||||
function notify(title, sub, msg) {
|
||||
$notify(title, sub || '', msg || '')
|
||||
}
|
||||
|
||||
const cookie = getHeader($request && $request.headers, 'Cookie')
|
||||
@@ -84,7 +78,7 @@ if (!cookie) {
|
||||
// 发给 Autman 机器人的完整快速登录命令。Autman 插件保留“启点ck <cookie>”快速提交通道。
|
||||
const submitText = `启点ck ${cookie}`
|
||||
const msg = submitText
|
||||
notify('启点读书', `抓取成功 uid:${uid}`, msg, copyAction(submitText))
|
||||
notify('启点读书', `抓取成功 uid:${uid}`, msg)
|
||||
$done({})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ function run({ cookie = '', body = '' }) {
|
||||
const notices = run({ cookie: `QDHeader=${encodeURIComponent(qdheader)}; QDH=abc` });
|
||||
assert.equal(notices[0][1], '抓取成功 uid:123456');
|
||||
assert.match(notices[0][2], /^启点ck /);
|
||||
assert.equal(notices[0].length, 3);
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user