update jd_blueCoin.js ,云端多账号内容全集中到一次通知,注:部分推送方式可能会对内容有长度限制可能会导致推送失败或者推送内容不完整

This commit is contained in:
lxk0301
2021-02-27 15:45:02 +08:00
parent 1617f94b75
commit 651d09d2ee

View File

@ -22,6 +22,7 @@ cron "0 0 0 * * *" script-path=https://gitee.com/lxk0301/jd_scripts/raw/master/j
*/
const $ = new Env('东东超市兑换奖品');
const notify = $.isNode() ? require('./sendNotify') : '';
let allMessage = '';
//Node.js用户请在jdCookie.js处填写京东ck;
const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
let coinToBeans = $.getdata('coinToBeans') || 20; //兑换多少数量的京豆20或者10000表示不兑换默认兑换20京豆如需兑换把0改成20或者1000或者'商品名称'(商品名称放到单引号内)即可
@ -88,6 +89,9 @@ const JD_API_HOST = `https://api.m.jd.com/api?appid=jdsupermarket`;
}
}
}
if ($.isNode() && allMessage) {
await notify.sendNotify(`${$.name}`, `${allMessage}`)
}
})()
.catch((e) => $.logErr(e))
.finally(() => $.done())
@ -355,9 +359,10 @@ function msgShow() {
//默认只在兑换奖品成功后弹窗提醒。情况情况加,只打印日志,不弹窗
if ($.beanscount && ctrTemp) {
$.msg($.name, ``, `【京东账号${$.index}${$.nickName}\n${coinToBeans ? `【兑换${$.title}${ $.beanscount ? `成功,数量:${$.beanscount}` : $.beanerr}` : "您设置的是不兑换奖品"}`);
if ($.isNode()) {
await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName}`, `【京东账号${$.index}${$.nickName}\n${coinToBeans ? `【兑换${$.title}${$.beanscount ? `成功,数量:${$.beanscount}` : $.beanerr}` : "您设置的是不兑换奖品"}`)
}
allMessage += `【京东账号${$.index}${$.nickName}\n${coinToBeans ? `【兑换${$.title}${$.beanscount ? `成功,数量:${$.beanscount}` : $.beanerr}` : "您设置的是不兑换奖品"}${$.index !== cookiesArr.length ? '\n\n' : ''}`
// if ($.isNode()) {
// await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName}`, `【京东账号${$.index}】${$.nickName}\n${coinToBeans ? `【兑换${$.title}】${$.beanscount ? `成功,数量:${$.beanscount}个` : $.beanerr}` : "您设置的是不兑换奖品"}`)
// }
}
resolve()
})