完善QQ酷推(Cool Push) 通知方式

This commit is contained in:
lxk0301
2020-12-21 15:02:09 +08:00
parent bbe6cfb0d2
commit 49c275b74f
3 changed files with 63 additions and 64 deletions

View File

@ -1,7 +1,7 @@
/*
京豆签到,自用,可N个京东账号,IOS软件用户请使用 https://raw.githubusercontent.com/NobyDa/Script/master/JD-DailyBonus/JD_DailyBonus.js
Node.JS专用
更新时间2020-11-27
更新时间2020-12-21
从 github @ruicky改写而来
version v0.0.1
create by ruicky
@ -42,9 +42,9 @@ if ($.isNode()) {
$.nickName = '';
await TotalBean();
console.log(`*****************开始京东账号${$.index} ${$.nickName || $.UserName}京豆签到*******************\n`);
console.log(`目前Bark APP推送通知消息对推送内容长度有限制使用此推送方式脚本会默认转换成简洁内容推送 ⚠️⚠️⚠️⚠️\n`)
console.log(`目前Bark APP推送通知消息对推送内容长度有限制推送通知中包含此推送方式脚本会默认转换成简洁内容推送 ⚠️⚠️⚠️⚠️\n`)
await changeFile(content);
await execSign();
await execSign();
}
}
})()
@ -53,15 +53,17 @@ if ($.isNode()) {
async function execSign() {
console.log(`\n开始执行脚本签到,请稍等`)
try {
if (notify.SCKEY || notify.BARK_PUSH || notify.DD_BOT_TOKEN || (notify.TG_BOT_TOKEN && notify.TG_USER_ID) || notify.IGOT_PUSH_KEY) {
await exec(`${process.execPath} ${JD_DailyBonusPath} >> ${resultPath}`);
const notifyContent = await fs.readFileSync(resultPath, "utf8");
console.log(`👇👇👇👇👇👇👇👇👇👇👇LOG记录👇👇👇👇👇👇👇👇👇👇👇\n${notifyContent}\n👆👆👆👆👆👆👆👆👆LOG记录👆👆👆👆👆👆👆👆👆👆👆`);
} else {
// 如果没有提供通知推送,则打印日志
console.log('没有提供通知推送,则打印脚本执行日志')
await exec(`${process.execPath} ${JD_DailyBonusPath}`, { stdio: "inherit" });
}
// if (notify.SCKEY || notify.BARK_PUSH || notify.DD_BOT_TOKEN || (notify.TG_BOT_TOKEN && notify.TG_USER_ID) || notify.IGOT_PUSH_KEY || notify.QQ_SKEY) {
// await exec(`${process.execPath} ${JD_DailyBonusPath} >> ${resultPath}`);
// const notifyContent = await fs.readFileSync(resultPath, "utf8");
// console.log(`👇👇👇👇👇👇👇👇👇👇👇LOG记录👇👇👇👇👇👇👇👇👇👇👇\n${notifyContent}\n👆👆👆👆👆👆👆👆👆LOG记录👆👆👆👆👆👆👆👆👆👆👆`);
// } else {
// console.log('没有提供通知推送,则打印脚本执行日志')
// await exec(`${process.execPath} ${JD_DailyBonusPath}`, { stdio: "inherit" });
// }
await exec(`${process.execPath} ${JD_DailyBonusPath} >> ${resultPath}`);
const notifyContent = await fs.readFileSync(resultPath, "utf8");
console.log(`👇👇👇👇👇👇👇👇👇👇👇LOG记录👇👇👇👇👇👇👇👇👇👇👇\n${notifyContent}\n👆👆👆👆👆👆👆👆👆LOG记录👆👆👆👆👆👆👆👆👆👆👆`);
// await exec("node JD_DailyBonus.js", { stdio: "inherit" });
// console.log('执行完毕', new Date(new Date().getTime() + 8 * 60 * 60 * 1000).toLocaleDateString())
//发送通知