对于已过期活动的脚本,添加通知提醒
This commit is contained in:
11
jr_sign.js
11
jr_sign.js
@@ -78,8 +78,14 @@ const JD_API_HOST = 'https://api.m.jd.com/api';
|
||||
})
|
||||
|
||||
function showMsg() {
|
||||
return new Promise(resolve => {
|
||||
$.msg($.name, '', `【京东账号${$.index}】${$.nickName}\n${message}`);
|
||||
return new Promise(async resolve => {
|
||||
let nowTime = new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000;
|
||||
if (nowTime > new Date('2020/12/31 23:59:59+08:00').getTime()) {
|
||||
$.msg($.name, '活动已结束', `咱江湖再见\nhttps://github.com/lxk0301/jd_scripts`, {"open-url": "https://github.com/lxk0301/jd_scripts"});
|
||||
if ($.isNode()) await notify.sendNotify($.name + '活动已结束', `咱江湖再见\n https://github.com/lxk0301/jd_scripts`)
|
||||
} else {
|
||||
$.msg($.name, '', `【京东账号${$.index}】${$.nickName}\n${message}`);
|
||||
}
|
||||
resolve()
|
||||
})
|
||||
}
|
||||
@@ -96,6 +102,7 @@ function sign() {
|
||||
if (safeGet(data)) {
|
||||
data = JSON.parse(data);
|
||||
console.log(data.resultData.message)
|
||||
message += `${data.resultData.message}`
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
|
Reference in New Issue
Block a user