修改报错
This commit is contained in:
@@ -26,7 +26,7 @@ const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
|
||||
let jdNotify = true;//是否关闭通知,false打开通知推送,true关闭通知推送
|
||||
const helpAuthor = false; // 是否帮助作者助力,false打开通知推送,true关闭通知推送
|
||||
//IOS等用户直接用NobyDa的jd cookie
|
||||
let cookiesArr = [], cookie = '', message;
|
||||
let cookiesArr = [], cookie = '', message = "" ;
|
||||
let newShareCodes = []
|
||||
let roleMap = {
|
||||
"jd_4521b375ebb5d": "锟子怪",
|
||||
@@ -41,7 +41,7 @@ let roleMap = {
|
||||
"jd_4311ac0ff4456": "居子"
|
||||
}
|
||||
let dingtalk = "https://oapi.dingtalk.com/robot/send?access_token=d2b6042cb38f0df63e20797c002208d2710104750c18a1dc84d54106a859a3f0"
|
||||
|
||||
let username = ""
|
||||
|
||||
|
||||
if ($.isNode()) {
|
||||
@@ -92,7 +92,7 @@ const JD_API_HOST = 'https://api.m.jd.com/';
|
||||
message += "----\n\n"
|
||||
}
|
||||
postToDingTalk(message)
|
||||
message += "<font color=\'#FFA500\'>[通知] </font><font color=\'#006400\' size='3'>额外领京豆</font> \n\n"
|
||||
message = "<font color=\'#FFA500\'>[通知] </font><font color=\'#006400\' size='3'>额外领京豆</font> \n\n"
|
||||
|
||||
for (let i = 0; i < cookiesArr.length; i++) {
|
||||
if (cookiesArr[i]) {
|
||||
|
||||
@@ -5,8 +5,8 @@ const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
|
||||
let jdNotify = true;//是否关闭通知,false打开通知推送,true关闭通知推送
|
||||
const randomCount = $.isNode() ? 0 : 5;
|
||||
//IOS等用户直接用NobyDa的jd cookie
|
||||
let cookiesArr = [], cookie = '', message;
|
||||
$.tuanList = [];
|
||||
let cookiesArr = [], cookie = '', message = "";
|
||||
let tuanList = [];
|
||||
let roleMap = {
|
||||
"jd_4521b375ebb5d": "锟子怪",
|
||||
"jd_542c10c0222bc": "康子怪",
|
||||
@@ -20,6 +20,8 @@ let roleMap = {
|
||||
"jd_4311ac0ff4456": "居子"
|
||||
}
|
||||
let dingtalk = "https://oapi.dingtalk.com/robot/send?access_token=d2b6042cb38f0df63e20797c002208d2710104750c18a1dc84d54106a859a3f0"
|
||||
let username = ""
|
||||
|
||||
|
||||
if ($.isNode()) {
|
||||
Object.keys(jdCookieNode).forEach((item) => {
|
||||
@@ -70,7 +72,7 @@ const JD_API_HOST = 'https://api.m.jd.com/api';
|
||||
|
||||
}
|
||||
postToDingTalk(message)
|
||||
message += "<font color=\'#FFA500\'>[通知] </font><font color=\'#006400\' size='3'>赚京豆</font> \n\n"
|
||||
message = "<font color=\'#FFA500\'>[通知] </font><font color=\'#006400\' size='3'>赚京豆</font> \n\n"
|
||||
|
||||
that.log(`\n\n内部互助 【赚京豆(微信小程序)-瓜分京豆】活动(优先内部账号互助(需内部cookie数量大于${$.assistNum || 4}个)\n`)
|
||||
for (let i = 0; i < cookiesArr.length; i++) {
|
||||
@@ -79,11 +81,11 @@ const JD_API_HOST = 'https://api.m.jd.com/api';
|
||||
cookie = cookiesArr[i];
|
||||
$.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1])
|
||||
if ($.canHelp && (cookiesArr.length > $.assistNum)) {
|
||||
if ($.tuanList.length) that.log(`开始账号内部互助 赚京豆-瓜分京豆 活动,优先内部账号互助`)
|
||||
for (let j = 0; j < $.tuanList.length; ++j) {
|
||||
that.log(`账号 ${$.UserName} 开始给 【${$.tuanList[j]['assistedPinEncrypted']}】助力`)
|
||||
message += "<font color=\'#FFA500\'>" + `账号 ${$.UserName} 开始给 【${$.tuanList[j]['assistedPinEncrypted']}】助力` + "</font> \n\n"
|
||||
await helpFriendTuan($.tuanList[j])
|
||||
if (tuanList.length) that.log(`开始账号内部互助 赚京豆-瓜分京豆 活动,优先内部账号互助`)
|
||||
for (let j = 0; j < tuanList.length; ++j) {
|
||||
that.log(`账号 ${$.UserName} 开始给 【${tuanList[j]['assistedPinEncrypted']}】助力`)
|
||||
message += "<font color=\'#FFA500\'>" + `账号 ${$.UserName} 开始给 【${tuanList[j]['assistedPinEncrypted']}】助力` + "</font> \n\n"
|
||||
await helpFriendTuan(tuanList[j])
|
||||
if (!$.canHelp) break
|
||||
await $.wait(200)
|
||||
}
|
||||
@@ -547,7 +549,7 @@ async function distributeBeanActivity() {
|
||||
if ($.hasOpen) await getUserTuanInfo()
|
||||
}
|
||||
if ($.tuan && $.tuan.hasOwnProperty('assistedPinEncrypted') && $.assistStatus !== 3) {
|
||||
$.tuanList.push($.tuan);
|
||||
tuanList.push($.tuan);
|
||||
const code = Object.assign($.tuan, { "time": Date.now() });
|
||||
$.post({
|
||||
url: `http://go.chiang.fun/autocommit`,
|
||||
|
||||
@@ -13,7 +13,7 @@ const notify = $.isNode() ? require('./sendNotify') : '';
|
||||
const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
|
||||
let jdNotify = true;//是否关闭通知,false打开通知推送,true关闭通知推送
|
||||
//IOS等用户直接用NobyDa的jd cookie
|
||||
let cookiesArr = [], cookie = '', message;
|
||||
let cookiesArr = [], cookie = '', message = "";
|
||||
const randomCount = $.isNode() ? 5 : 5;
|
||||
let cash_exchange = false;//是否消耗2元红包兑换200京豆,默认否
|
||||
let shareCodes = []; //助力码
|
||||
@@ -28,8 +28,10 @@ let roleMap = {
|
||||
"jd_4333d5dc1ac5f": "舒楠子",
|
||||
"jd_66ea783827d30": "军子",
|
||||
"jd_4311ac0ff4456": "居子"
|
||||
}
|
||||
let dingtalk = "https://oapi.dingtalk.com/robot/send?access_token=d2b6042cb38f0df63e20797c002208d2710104750c18a1dc84d54106a859a3f0"
|
||||
}
|
||||
let dingtalk = "https://oapi.dingtalk.com/robot/send?access_token=d2b6042cb38f0df63e20797c002208d2710104750c18a1dc84d54106a859a3f0"
|
||||
|
||||
let username = ""
|
||||
|
||||
if ($.isNode()) {
|
||||
Object.keys(jdCookieNode).forEach((item) => {
|
||||
@@ -45,7 +47,7 @@ let allMessage = '';
|
||||
$.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', { "open-url": "https://bean.m.jd.com/bean/signIndex.action" });
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
message += "<font color=\'#FFA500\'>[通知] </font><font color=\'#006400\' size='3'>签到领现金</font> \n\n"
|
||||
for (let i = 0; i < cookiesArr.length; i++) {
|
||||
if (cookiesArr[i]) {
|
||||
@@ -58,9 +60,9 @@ let allMessage = '';
|
||||
|
||||
if (roleMap[username] != undefined) {
|
||||
username = roleMap[username]
|
||||
}
|
||||
//加上名称
|
||||
message = message + "<font color=\'#778899\' size=2>【羊毛姐妹】<font color=\'#FFA500\' size=3>" + username + " </font> </font> \n\n "
|
||||
}
|
||||
//加上名称
|
||||
message = message + "<font color=\'#778899\' size=2>【羊毛姐妹】<font color=\'#FFA500\' size=3>" + username + " </font> </font> \n\n "
|
||||
console.log(`\n******开始【京东账号${$.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" });
|
||||
@@ -75,7 +77,7 @@ let allMessage = '';
|
||||
}
|
||||
|
||||
postToDingTalk(message)
|
||||
message += "<font color=\'#FFA500\'>[通知] </font><font color=\'#006400\' size='3'>签到领现金</font> \n\n"
|
||||
message = "<font color=\'#FFA500\'>[通知] </font><font color=\'#006400\' size='3'>签到领现金</font> \n\n"
|
||||
|
||||
for (let i = 0; i < cookiesArr.length; i++) {
|
||||
if (cookiesArr[i]) {
|
||||
@@ -128,18 +130,18 @@ async function appindex(info = false) {
|
||||
if (message) {
|
||||
allMessage += `京东账号${$.index}${$.nickName}\n${message}${$.index !== cookiesArr.length ? '\n\n' : ''}`;
|
||||
}
|
||||
message += "<font color=\'#FFA500\'>" + `当前现金:${data.data.result.totalMoney}元`+ "</font> \n\n"
|
||||
message += "<font color=\'#FFA500\'>" + `当前现金:${data.data.result.totalMoney}元` + "</font> \n\n"
|
||||
console.log(`\n\n当前现金:${data.data.result.totalMoney}元`);
|
||||
return
|
||||
}
|
||||
$.signMoney = data.data.result.totalMoney;
|
||||
|
||||
|
||||
console.log(`\n【京东账号${$.index}(${$.UserName})的${$.name}好友互助码】${data.data.result.invitedCode}\n`);
|
||||
let helpInfo = {
|
||||
'inviteCode': data.data.result.invitedCode,
|
||||
'shareDate': data.data.result.shareDate
|
||||
}
|
||||
shareCodes = shareCodes.push(helpInfo) //添加我的助力码
|
||||
}
|
||||
shareCodes = shareCodes.push(helpInfo) //添加我的助力码
|
||||
|
||||
for (let task of data.data.result.taskInfos) {
|
||||
if (task.type === 4) {
|
||||
@@ -232,7 +234,7 @@ async function helpFriends() {
|
||||
$.canHelp = true
|
||||
for (let code of shareCodes) {
|
||||
console.log(`去帮助好友${code['inviteCode']}`)
|
||||
message += "<font color=\'#FFA500\'>" + `去帮助好友${code['inviteCode']}`+ "</font> \n\n"
|
||||
message += "<font color=\'#FFA500\'>" + `去帮助好友${code['inviteCode']}` + "</font> \n\n"
|
||||
await helpFriend(code)
|
||||
if (!$.canHelp) break
|
||||
await $.wait(1000)
|
||||
@@ -250,8 +252,8 @@ function helpFriend(helpInfo) {
|
||||
if (safeGet(data)) {
|
||||
data = JSON.parse(data);
|
||||
if (data.code === 0 && data.data.bizCode === 0) {
|
||||
|
||||
message += "<font color=\'#FFA500\'>" + `助力成功,获得${data.data.result.cashStr}`+ "</font> \n\n"
|
||||
|
||||
message += "<font color=\'#FFA500\'>" + `助力成功,获得${data.data.result.cashStr}` + "</font> \n\n"
|
||||
console.log(`助力成功,获得${data.data.result.cashStr}`)
|
||||
// console.log(data.data.result.taskInfos)
|
||||
} else if (data.data.bizCode === 207) {
|
||||
@@ -340,8 +342,8 @@ function getReward(source = 1) {
|
||||
data = JSON.parse(data);
|
||||
if (data.code === 0 && data.data.bizCode === 0) {
|
||||
console.log(`领奖成功,${data.data.result.shareRewardTip}【${data.data.result.shareRewardAmount}】`)
|
||||
message += "<font color=\'#FFA500\'>" +`领奖成功,${data.data.result.shareRewardTip}【${data.data.result.shareRewardAmount}元】\n`+ "</font> \n\n"
|
||||
|
||||
message += "<font color=\'#FFA500\'>" + `领奖成功,${data.data.result.shareRewardTip}【${data.data.result.shareRewardAmount}元】\n` + "</font> \n\n"
|
||||
|
||||
// console.log(data.data.result.taskInfos)
|
||||
} else {
|
||||
// console.log(`领奖失败,${data.data.bizMsg}`)
|
||||
@@ -649,46 +651,46 @@ function Env(t, e) { "undefined" != typeof process && JSON.stringify(process.env
|
||||
function postToDingTalk(messgae) {
|
||||
const message1 = "" + messgae
|
||||
// that.log(messgae)
|
||||
|
||||
|
||||
const body = {
|
||||
"msgtype": "markdown",
|
||||
"markdown": {
|
||||
"title": "签到领现金",
|
||||
"text": message1
|
||||
},
|
||||
"at": {
|
||||
"atMobiles": [],
|
||||
"isAtAll": false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$.post(toDingtalk(dingtalk, JSON.stringify(body)), (data, status, xhr) => {
|
||||
try {
|
||||
that.log(resp)
|
||||
that.log(data)
|
||||
if (err) {
|
||||
that.log(JSON.stringify(err));
|
||||
$.logErr(err);
|
||||
} else {
|
||||
if (safeGet(data)) {
|
||||
$.duckRes = JSON.parse(data);
|
||||
}
|
||||
"msgtype": "markdown",
|
||||
"markdown": {
|
||||
"title": "签到领现金",
|
||||
"text": message1
|
||||
},
|
||||
"at": {
|
||||
"atMobiles": [],
|
||||
"isAtAll": false
|
||||
}
|
||||
} catch (e) {
|
||||
$.logErr(e, resp)
|
||||
} finally {
|
||||
resolve();
|
||||
}
|
||||
}, "json")
|
||||
}
|
||||
|
||||
|
||||
function toDingtalk(urlmain, bodyMain) {
|
||||
return {
|
||||
url: urlmain,
|
||||
body: bodyMain,
|
||||
headers: { 'Content-Type': 'application/json;charset=utf-8' },
|
||||
timeout: 10000,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$.post(toDingtalk(dingtalk, JSON.stringify(body)), (data, status, xhr) => {
|
||||
try {
|
||||
that.log(resp)
|
||||
that.log(data)
|
||||
if (err) {
|
||||
that.log(JSON.stringify(err));
|
||||
$.logErr(err);
|
||||
} else {
|
||||
if (safeGet(data)) {
|
||||
$.duckRes = JSON.parse(data);
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
$.logErr(e, resp)
|
||||
} finally {
|
||||
resolve();
|
||||
}
|
||||
}, "json")
|
||||
}
|
||||
|
||||
|
||||
function toDingtalk(urlmain, bodyMain) {
|
||||
return {
|
||||
url: urlmain,
|
||||
body: bodyMain,
|
||||
headers: { 'Content-Type': 'application/json;charset=utf-8' },
|
||||
timeout: 10000,
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -45,7 +45,7 @@ let roleMap = {
|
||||
"jd_4311ac0ff4456": "居子"
|
||||
}
|
||||
let dingtalk = "https://oapi.dingtalk.com/robot/send?access_token=d2b6042cb38f0df63e20797c002208d2710104750c18a1dc84d54106a859a3f0"
|
||||
|
||||
let username = ""
|
||||
|
||||
//IOS等用户直接用NobyDa的jd cookie
|
||||
let cookiesArr = [], cookie = '', message = '', allMessage = '';
|
||||
@@ -116,7 +116,7 @@ const JD_API_HOST = 'https://api.m.jd.com/client.action';
|
||||
}
|
||||
postToDingTalk(message)
|
||||
|
||||
message += "<font color=\'#FFA500\'>[通知] </font><font color=\'#006400\' size='3'>摇京豆</font> \n\n"
|
||||
message = "<font color=\'#FFA500\'>[通知] </font><font color=\'#006400\' size='3'>摇京豆</font> \n\n"
|
||||
|
||||
//开始助力
|
||||
for (let v = 0; v < cookiesArr.length; v++) {
|
||||
|
||||
Reference in New Issue
Block a user