更新于 07-15 21:02

This commit is contained in:
root
2021-07-15 21:03:01 -04:00
parent c3f90d060d
commit 1000f51adb

View File

@ -3,7 +3,7 @@
活动入口:各处的签到汇总 活动入口:各处的签到汇总
Node.JS专用 Node.JS专用
IOS软件用户请使用 https://raw.githubusercontent.com/NobyDa/Script/master/JD-DailyBonus/JD_DailyBonus.js IOS软件用户请使用 https://raw.githubusercontent.com/NobyDa/Script/master/JD-DailyBonus/JD_DailyBonus.js
更新时间2021-5-6 更新时间2021-6-18
推送通知默认简洁模式(多账号只发送一次)。如需详细通知,设置环境变量 JD_BEAN_SIGN_NOTIFY_SIMPLE 为false即可(N账号推送N次通知)。 推送通知默认简洁模式(多账号只发送一次)。如需详细通知,设置环境变量 JD_BEAN_SIGN_NOTIFY_SIMPLE 为false即可(N账号推送N次通知)。
Modified From github https://github.com/ruicky/jd_sign_bot Modified From github https://github.com/ruicky/jd_sign_bot
*/ */
@ -47,8 +47,16 @@ if ($.isNode()) {
$.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]) $.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1])
$.index = i + 1; $.index = i + 1;
$.nickName = ''; $.nickName = '';
$.isLogin = true;
await TotalBean(); await TotalBean();
console.log(`*****************开始京东账号${$.index} ${$.nickName || $.UserName}京豆签到*******************\n`); console.log(`*****************开始京东账号${$.index} ${$.nickName || $.UserName}京豆签到*******************\n`);
if (!$.isLogin) {
$.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action`, {"open-url": "https://bean.m.jd.com/bean/signIndex.action"});
if ($.isNode()) {
await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`);
}
continue
}
await changeFile(content); await changeFile(content);
await execSign(); await execSign();
} }
@ -116,7 +124,7 @@ async function downFile () {
let url = ''; let url = '';
await downloadUrl(); await downloadUrl();
if ($.body) { if ($.body) {
url = 'https://raw.githubusercontent.com/NobyDa/Script/master/JD-DailyBonus/JD_DailyBonus.js'; url = 'https://raw.fastgit.org/NobyDa/Script/master/JD-DailyBonus/JD_DailyBonus.js';
} else { } else {
url = 'https://cdn.jsdelivr.net/gh/NobyDa/Script@master/JD-DailyBonus/JD_DailyBonus.js'; url = 'https://cdn.jsdelivr.net/gh/NobyDa/Script@master/JD-DailyBonus/JD_DailyBonus.js';
} }
@ -266,7 +274,7 @@ function requireConfig() {
// NodeSet = err ? '/tmp/CookieSet.json' : NodeSet; // NodeSet = err ? '/tmp/CookieSet.json' : NodeSet;
// resolve() // resolve()
// }); // });
//判断是否是云函数环境。原函数目录目录没有可写入权限,文件只能放到根目录下虚拟的/temp/文件夹(具有可写入权限) //判断是否是云函数环境。原函数目录目录没有可写入权限,文件只能放到根目录下虚拟的/temp/文件夹(具有可写入权限)
resultPath = process.env.TENCENTCLOUD_RUNENV === 'SCF' ? '/tmp/result.txt' : resultPath; resultPath = process.env.TENCENTCLOUD_RUNENV === 'SCF' ? '/tmp/result.txt' : resultPath;
JD_DailyBonusPath = process.env.TENCENTCLOUD_RUNENV === 'SCF' ? '/tmp/JD_DailyBonus.js' : JD_DailyBonusPath; JD_DailyBonusPath = process.env.TENCENTCLOUD_RUNENV === 'SCF' ? '/tmp/JD_DailyBonus.js' : JD_DailyBonusPath;
outPutUrl = process.env.TENCENTCLOUD_RUNENV === 'SCF' ? '/tmp/' : outPutUrl; outPutUrl = process.env.TENCENTCLOUD_RUNENV === 'SCF' ? '/tmp/' : outPutUrl;