修复在 JD_BEAN_SIGN_STOP_NOTIFY设置为true不进行通知时,result.txt文件未被删掉一直累加的bug

This commit is contained in:
wisz2021
2021-05-06 15:23:35 +08:00
parent 65edb53923
commit 4d0ccfed92

View File

@ -6,7 +6,7 @@
活动入口:各处的签到汇总
Node.JS专用
IOS软件用户请使用 https://raw.githubusercontent.com/NobyDa/Script/master/JD-DailyBonus/JD_DailyBonus.js
更新时间2021-4-9
更新时间2021-5-6
推送通知默认简洁模式(多账号只发送一次)。如需详细通知,设置环境变量 JD_BEAN_SIGN_NOTIFY_SIMPLE 为false即可(N账号推送N次通知)。
Modified From github https://github.com/ruicky/jd_sign_bot
*/
@ -84,8 +84,7 @@ async function execSign() {
if (fs.existsSync(resultPath)) {
const barkContentStart = notifyContent.indexOf('【签到概览】')
const barkContentEnd = notifyContent.length;
if (process.env.JD_BEAN_SIGN_STOP_NOTIFY === 'true') return
if (process.env.BARK_PUSH || notify.BARK_PUSH) process.env.JD_BEAN_SIGN_NOTIFY_SIMPLE = 'true';
if (process.env.JD_BEAN_SIGN_STOP_NOTIFY !== 'true') {
if (process.env.JD_BEAN_SIGN_NOTIFY_SIMPLE === 'true') {
if (barkContentStart > -1 && barkContentEnd > -1) {
BarkContent = notifyContent.substring(barkContentStart, barkContentEnd);
@ -97,6 +96,7 @@ async function execSign() {
}
}
}
}
//不管哪个时区,这里得到的都是北京时间的时间戳;
const UTC8 = new Date().getTime() + new Date().getTimezoneOffset()*60000 + 28800000;
$.beanSignTime = new Date(UTC8).toLocaleString('zh', {hour12: false});