From 9efabe6053c542520ab0e3e7b2a403e167b6266b Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Sat, 27 Feb 2021 23:20:07 +0800 Subject: [PATCH] =?UTF-8?q?update=20jd=5Fbean=5Fsign.js,=E5=A6=82=E6=9E=9C?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E4=BA=86=E7=AE=80=E6=B4=81=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F(=E5=8D=B3process.env.JD=5FBEAN=5FSIGN=5FNOTI?= =?UTF-8?q?FY=5FSIMPLE=E4=B8=BAtrue),=E5=88=99=E4=BA=91=E7=AB=AF=E5=A4=9A?= =?UTF-8?q?=E8=B4=A6=E5=8F=B7=E5=86=85=E5=AE=B9=E5=85=A8=E9=9B=86=E4=B8=AD?= =?UTF-8?q?=E5=88=B0=E4=B8=80=E6=AC=A1=E9=80=9A=E7=9F=A5,=E6=B3=A8:?= =?UTF-8?q?=E9=83=A8=E5=88=86=E6=8E=A8=E9=80=81=E6=96=B9=E5=BC=8F=E5=8F=AF?= =?UTF-8?q?=E8=83=BD=E4=BC=9A=E5=AF=B9=E5=86=85=E5=AE=B9=E6=9C=89=E9=95=BF?= =?UTF-8?q?=E5=BA=A6=E9=99=90=E5=88=B6=E5=8F=AF=E8=83=BD=E4=BC=9A=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E6=8E=A8=E9=80=81=E5=A4=B1=E8=B4=A5=E6=88=96=E8=80=85?= =?UTF-8?q?=E6=8E=A8=E9=80=81=E5=86=85=E5=AE=B9=E4=B8=8D=E5=AE=8C=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jd_bean_sign.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/jd_bean_sign.js b/jd_bean_sign.js index c3f44d56..77aa53ff 100644 --- a/jd_bean_sign.js +++ b/jd_bean_sign.js @@ -6,10 +6,10 @@ 活动入口:各处的签到汇总 Node.JS专用 IOS软件用户请使用 https://raw.githubusercontent.com/NobyDa/Script/master/JD-DailyBonus/JD_DailyBonus.js -更新时间:2021-1-19 +更新时间:2021-2-27 Modified From github https://github.com/ruicky/jd_sign_bot */ -const $ = new Env('京豆签到'); +const $ = new Env('京东多合一签到'); const notify = $.isNode() ? require('./sendNotify') : ''; //Node.js用户请在jdCookie.js处填写京东ck; const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; @@ -20,7 +20,7 @@ let resultPath = "./result.txt"; let JD_DailyBonusPath = "./JD_DailyBonus.js"; let outPutUrl = './'; let NodeSet = 'CookieSet.json'; -let cookiesArr = [], cookie = ''; +let cookiesArr = [], cookie = '', allMessage = ''; if ($.isNode()) { Object.keys(jdCookieNode).forEach((item) => { @@ -50,6 +50,9 @@ if ($.isNode()) { await execSign(); } } + if ($.isNode() && allMessage && process.env.JD_BEAN_SIGN_NOTIFY_SIMPLE === 'true') { + await notify.sendNotify(`${$.name}`, `${allMessage}`) + } })() .catch((e) => $.logErr(e)) .finally(() => $.done()) @@ -95,7 +98,10 @@ async function execSign() { $.beanSignTime = timeFormat(UTC8); console.log(`脚本执行完毕时间:${$.beanSignTime}`) if (BarkContent) { - await notify.sendNotify(`京豆签到 - 账号${$.index} - ${$.nickName || $.UserName}`, `【签到号 ${$.index}】: ${$.nickName || $.UserName}\n【签到时间】: ${$.beanSignTime}\n${BarkContent}`); + allMessage += `【京东号 ${$.index}】: ${$.nickName || $.UserName}\n【签到时间】: ${$.beanSignTime}\n${BarkContent}${$.index !== cookiesArr.length ? '\n\n' : ''}`; + if (!process.env.JD_BEAN_SIGN_NOTIFY_SIMPLE || (process.env.JD_BEAN_SIGN_NOTIFY_SIMPLE && process.env.JD_BEAN_SIGN_NOTIFY_SIMPLE !== 'true')) { + await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName || $.UserName}`, `【签到号 ${$.index}】: ${$.nickName || $.UserName}\n【签到时间】: ${$.beanSignTime}\n${BarkContent}`); + } } } //运行完成后,删除下载的文件