This commit is contained in:
Faker
2022-02-27 19:07:47 +08:00
parent 5cadab9349
commit 39f8ed28d2
2 changed files with 253 additions and 132 deletions

View File

@@ -39,8 +39,7 @@ const JD_API_HOST = 'https://api.m.jd.com/client.action';
const urlSchema = `openjd://virtual?params=%7B%20%22category%22:%20%22jump%22,%20%22des%22:%20%22m%22,%20%22url%22:%20%22https://h5.m.jd.com/babelDiy/Zeus/3KSjXqQabiTuD1cJ28QskrpWoBKT/index.html%22%20%7D`; const urlSchema = `openjd://virtual?params=%7B%20%22category%22:%20%22jump%22,%20%22des%22:%20%22m%22,%20%22url%22:%20%22https://h5.m.jd.com/babelDiy/Zeus/3KSjXqQabiTuD1cJ28QskrpWoBKT/index.html%22%20%7D`;
let NowHour = new Date().getHours(); let NowHour = new Date().getHours();
let llhelp=true; let llhelp=true;
if ($.isNode() && process.env.CC_NOHELPAFTER8) { if ($.isNode() && process.env.CC_NOHELPAFTER8) {
console.log(NowHour);
if (process.env.CC_NOHELPAFTER8=="true"){ if (process.env.CC_NOHELPAFTER8=="true"){
if (NowHour>8){ if (NowHour>8){
llhelp=false; llhelp=false;
@@ -48,17 +47,38 @@ if ($.isNode() && process.env.CC_NOHELPAFTER8) {
} }
} }
} }
const fs = require('fs');
let boolneedUpdate=false;
let strShare = './Fruit_ShareCache.json';
let Fileexists = fs.existsSync(strShare);
let TempShareCache = [];
if (Fileexists) {
console.log("检测到东东农场缓存文件Fruit_ShareCache.json载入...");
TempShareCache = fs.readFileSync(strShare, 'utf-8');
if (TempShareCache) {
TempShareCache = TempShareCache.toString();
TempShareCache = JSON.parse(TempShareCache);
}
}
let WP_APP_TOKEN_ONE = ""; let WP_APP_TOKEN_ONE = "";
if ($.isNode()) { if ($.isNode()) {
if (process.env.WP_APP_TOKEN_ONE) { if (process.env.WP_APP_TOKEN_ONE) {
WP_APP_TOKEN_ONE = process.env.WP_APP_TOKEN_ONE; WP_APP_TOKEN_ONE = process.env.WP_APP_TOKEN_ONE;
} }
} }
if(WP_APP_TOKEN_ONE)
console.log(`检测到已配置Wxpusher的Token启用一对一推送...`); if (WP_APP_TOKEN_ONE) {
else console.log(`检测到已配置Wxpusher的Token启用一对一推送...`);
console.log(`检测到未配置Wxpusher的Token禁用一对一推送...`); if (NowHour <9 || NowHour > 21) {
WP_APP_TOKEN_ONE = "";
console.log(`农场只在9点后和22点前启用一对一推送故此次暂时取消一对一推送...`);
}
} else
console.log(`检测到未配置Wxpusher的Token禁用一对一推送...`);
let lnrun=0;
let llgetshare=false;
let NoNeedCodes = [];
!(async () => { !(async () => {
await requireConfig(); await requireConfig();
@@ -66,55 +86,87 @@ else
$.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', { "open-url": "https://bean.m.jd.com/bean/signIndex.action" }); $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', { "open-url": "https://bean.m.jd.com/bean/signIndex.action" });
return; return;
} }
if(llhelp){ if (llhelp) {
console.log('开始收集您的互助码,用于账号内部互助,请稍等...'); console.log('开始收集您的互助码,用于账号内部互助,请稍等...');
for (let i = 0; i < cookiesArr.length; i++) { for (let i = 0; i < cookiesArr.length; i++) {
if (cookiesArr[i]) { if (cookiesArr[i]) {
cookie = cookiesArr[i]; cookie = cookiesArr[i];
$.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;
$.isLogin = true; $.isLogin = true;
$.nickName = ''; $.nickName = '';
await TotalBean(); await TotalBean();
if (!$.isLogin) { 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" }); $.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()) { if ($.isNode()) {
await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`); await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`);
} }
continue continue
} }
message = ''; message = '';
subTitle = ''; subTitle = '';
option = {}; option = {};
$.retry = 0; $.retry = 0;
await GetCollect(); llgetshare=false;
} await GetCollect();
} if(llgetshare){
await $.wait(5000);
lnrun++;
}
if(lnrun==10){
console.log(`访问接口次数达到10次休息一分钟.....`);
await $.wait(60*1000);
lnrun=0;
}
}
}
if (boolneedUpdate) {
var str = JSON.stringify(TempShareCache, null, 2);
fs.writeFile(strShare, str, function (err) {
if (err) {
console.log(err);
console.log("缓存文件Fruit_ShareCache.json更新失败!");
} else {
console.log("缓存文件Fruit_ShareCache.json更新成功!");
}
})
}
} }
for (let i = 0; i < cookiesArr.length; i++) { for (let i = 0; i < cookiesArr.length; i++) {
if (cookiesArr[i]) { if (cookiesArr[i]) {
cookie = cookiesArr[i]; cookie = cookiesArr[i];
$.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;
$.isLogin = true; $.isLogin = true;
$.nickName = ''; $.nickName = '';
await TotalBean(); await TotalBean();
console.log(`\n开始【京东账号${$.index}${$.nickName || $.UserName}\n`); console.log(`\n开始【京东账号${$.index}${$.nickName || $.UserName}\n`);
if (!$.isLogin) { 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" }); $.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()) { if ($.isNode()) {
await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`); await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`);
} }
continue continue
}
message = '';
subTitle = '';
option = {};
$.retry = 0;
lnrun++;
await jdFruit();
if (lnrun == 5) {
console.log(`访问接口次数达到5次休息一分钟.....`);
await $.wait(60 * 1000);
lnrun = 0;
}
} }
message = '';
subTitle = '';
option = {};
$.retry = 0;
await jdFruit();
}
} }
if ($.isNode() && allMessage && $.ctrTemp) { if ($.isNode() && allMessage && $.ctrTemp) {
await notify.sendNotify(`${$.name}`, `${allMessage}`) await notify.sendNotify(`${$.name}`, `${allMessage}`)
@@ -293,56 +345,66 @@ async function predictionFruit() {
} }
//浇水十次 //浇水十次
async function doTenWater() { async function doTenWater() {
jdFruitBeanCard = $.getdata('jdFruitBeanCard') ? $.getdata('jdFruitBeanCard') : jdFruitBeanCard; try {
if ($.isNode() && process.env.FRUIT_BEAN_CARD) { jdFruitBeanCard = $.getdata('jdFruitBeanCard') ? $.getdata('jdFruitBeanCard') : jdFruitBeanCard;
jdFruitBeanCard = process.env.FRUIT_BEAN_CARD; if ($.isNode() && process.env.FRUIT_BEAN_CARD) {
} jdFruitBeanCard = process.env.FRUIT_BEAN_CARD;
await myCardInfoForFarm();
const { fastCard, doubleCard, beanCard, signCard } = $.myCardInfoRes;
if (`${jdFruitBeanCard}` === 'true' && JSON.stringify($.myCardInfoRes).match(`限时翻倍`) && beanCard > 0) {
console.log(`您设置的是使用水滴换豆卡,且背包有水滴换豆卡${beanCard}张, 跳过10次浇水任务`)
return
}
if ($.farmTask.totalWaterTaskInit.totalWaterTaskTimes < $.farmTask.totalWaterTaskInit.totalWaterTaskLimit) {
console.log(`\n准备浇水十次`);
let waterCount = 0;
isFruitFinished = false;
for (; waterCount < $.farmTask.totalWaterTaskInit.totalWaterTaskLimit - $.farmTask.totalWaterTaskInit.totalWaterTaskTimes; waterCount++) {
console.log(`${waterCount + 1}次浇水`);
await waterGoodForFarm();
console.log(`本次浇水结果: ${JSON.stringify($.waterResult)}`);
if ($.waterResult.code === '0') {
console.log(`剩余水滴${$.waterResult.totalEnergy}g`);
if ($.waterResult.finished) {
// 已证实waterResult.finished为true表示水果可以去领取兑换了
isFruitFinished = true;
break
} else {
if ($.waterResult.totalEnergy < 10) {
console.log(`水滴不够,结束浇水`)
break
}
await gotStageAward();//领取阶段性水滴奖励
} }
} else { await myCardInfoForFarm();
console.log('浇水出现失败异常,跳出不在继续浇水') const {
break; fastCard,
} doubleCard,
beanCard,
signCard
} = $.myCardInfoRes;
/* if (`${jdFruitBeanCard}` === 'true' && JSON.stringify($.myCardInfoRes).match(`限时翻倍`) && beanCard > 0) {
console.log(`您设置的是使用水滴换豆卡,且背包有水滴换豆卡${beanCard}张, 跳过10次浇水任务`)
return
} */
if ($.farmTask.totalWaterTaskInit.totalWaterTaskTimes < $.farmTask.totalWaterTaskInit.totalWaterTaskLimit) {
console.log(`\n准备浇水十次`);
let waterCount = 0;
isFruitFinished = false;
for (; waterCount < $.farmTask.totalWaterTaskInit.totalWaterTaskLimit - $.farmTask.totalWaterTaskInit.totalWaterTaskTimes; waterCount++) {
console.log(`${waterCount + 1}次浇水`);
await waterGoodForFarm();
console.log(`本次浇水结果: ${JSON.stringify($.waterResult)}`);
if ($.waterResult.code === '0') {
console.log(`剩余水滴${$.waterResult.totalEnergy}g`);
if ($.waterResult.finished) {
// 已证实waterResult.finished为true表示水果可以去领取兑换了
isFruitFinished = true;
break
} else {
if ($.waterResult.totalEnergy < 10) {
console.log(`水滴不够,结束浇水`)
break
}
await gotStageAward(); //领取阶段性水滴奖励
}
} else {
console.log('浇水出现失败异常,跳出不在继续浇水')
break;
}
}
if (isFruitFinished) {
option['open-url'] = urlSchema;
$.msg($.name, ``, `【京东账号${$.index}${$.nickName || $.UserName}\n【提醒⏰】${$.farmInfo.farmUserPro.name}已可领取\n请去京东APP或微信小程序查看\n点击弹窗即达`, option);
$.done();
if ($.isNode()) {
await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName || $.UserName}水果已可领取`, `京东账号${$.index} ${$.nickName || $.UserName}\n${$.farmInfo.farmUserPro.name}已可领取`);
}
if ($.isNode() && WP_APP_TOKEN_ONE) {
await notify.sendNotifybyWxPucher($.name, `【提醒⏰】${$.farmInfo.farmUserPro.name}已可领取\n【领取步骤】京东->我的->东东农场兑换京东红包,可以用于京东app的任意商品.`, `${$.UserName}`);
}
}
} else {
console.log('\n今日已完成10次浇水任务\n');
}
} catch (e) {
console.log(`doTenWater 任务执行异常‼️‼️`);
$.logErr(e);
} }
if (isFruitFinished) {
option['open-url'] = urlSchema;
$.msg($.name, ``, `【京东账号${$.index}${$.nickName || $.UserName}\n【提醒⏰】${$.farmInfo.farmUserPro.name}已可领取\n请去京东APP或微信小程序查看\n点击弹窗即达`, option);
$.done();
if ($.isNode()) {
await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName || $.UserName}水果已可领取`, `京东账号${$.index} ${$.nickName || $.UserName}\n${$.farmInfo.farmUserPro.name}已可领取`);
}
if ($.isNode() && WP_APP_TOKEN_ONE) {
await notify.sendNotifybyWxPucher($.name, `【提醒⏰】${$.farmInfo.farmUserPro.name}已可领取\n【领取步骤】京东->我的->东东农场兑换京东红包,可以用于京东app的任意商品.`, `${$.UserName}`);
}
}
} else {
console.log('\n今日已完成10次浇水任务\n');
}
} }
//领取首次浇水奖励 //领取首次浇水奖励
async function getFirstWaterAward() { async function getFirstWaterAward() {
@@ -412,17 +474,22 @@ async function doTenWaterAgain() {
} }
if (`${jdFruitBeanCard}` === 'true' && JSON.stringify($.myCardInfoRes).match('限时翻倍')) { if (`${jdFruitBeanCard}` === 'true' && JSON.stringify($.myCardInfoRes).match('限时翻倍')) {
console.log(`\n您设置的是水滴换豆功能,现在为您换豆`); console.log(`\n您设置的是水滴换豆功能,现在为您换豆`);
if (totalEnergy >= 100 && $.myCardInfoRes.beanCard > 0) {
//使用水滴换豆卡 for (let lncount = 0; lncount < $.myCardInfoRes.beanCard; lncount++) {
await userMyCardForFarm('beanCard'); if (totalEnergy >= 150 && $.myCardInfoRes.beanCard > 0) {
console.log(`使用水滴换豆卡结果:${JSON.stringify($.userMyCardRes)}`); //使用水滴换豆卡
if ($.userMyCardRes.code === '0') { await userMyCardForFarm('beanCard');
message += `水滴换豆卡】获得${$.userMyCardRes.beanCount}个京豆\n`; console.log(`使用水滴换豆卡结果:${JSON.stringify($.userMyCardRes)}`);
return if ($.userMyCardRes.code === '0') {
} totalEnergy=totalEnergy-100;
} else { message += `【水滴换豆卡】获得${$.userMyCardRes.beanCount}个京豆\n`;
console.log(`您目前水滴:${totalEnergy}g,水滴换豆卡${$.myCardInfoRes.beanCard}张,暂不满足水滴换豆的条件,为您继续浇水`) }
} } else {
console.log(`您目前水滴:${totalEnergy}g,水滴换豆卡${$.myCardInfoRes.beanCard}张,暂不满足水滴换豆的条件,为您继续浇水`)
break;
}
}
return;
} }
// if (totalEnergy > 100 && $.myCardInfoRes.fastCard > 0) { // if (totalEnergy > 100 && $.myCardInfoRes.fastCard > 0) {
// //使用快速浇水卡 // //使用快速浇水卡
@@ -716,6 +783,19 @@ async function masterHelpShare() {
if(llhelp){ if(llhelp){
console.log('开始助力好友') console.log('开始助力好友')
for (let code of newShareCodes) { for (let code of newShareCodes) {
if(NoNeedCodes){
var llnoneed=false;
for (let NoNeedCode of NoNeedCodes) {
if (code==NoNeedCode){
llnoneed=true;
break;
}
}
if(llnoneed){
console.log(`${code}助力已满,跳过...`);
continue;
}
}
console.log(`${$.UserName}开始助力: ${code}`); console.log(`${$.UserName}开始助力: ${code}`);
if (!code) continue; if (!code) continue;
if (!$.farmInfo.farmUserPro) { if (!$.farmInfo.farmUserPro) {
@@ -739,6 +819,7 @@ async function masterHelpShare() {
} else if ($.helpResult.helpResult.code === '9') { } else if ($.helpResult.helpResult.code === '9') {
console.log(`【助力好友结果】: 之前给【${$.helpResult.helpResult.masterUserInfo.nickName}】助力过了`); console.log(`【助力好友结果】: 之前给【${$.helpResult.helpResult.masterUserInfo.nickName}】助力过了`);
} else if ($.helpResult.helpResult.code === '10') { } else if ($.helpResult.helpResult.code === '10') {
NoNeedCodes.push(code);
console.log(`【助力好友结果】: 好友【${$.helpResult.helpResult.masterUserInfo.nickName}】已满五人助力`); console.log(`【助力好友结果】: 好友【${$.helpResult.helpResult.masterUserInfo.nickName}】已满五人助力`);
} else { } else {
console.log(`助力其他情况:${JSON.stringify($.helpResult.helpResult)}`); console.log(`助力其他情况:${JSON.stringify($.helpResult.helpResult)}`);
@@ -789,7 +870,7 @@ async function executeWaterRains() {
if (Date.now() < ($.farmTask.waterRainInit.lastTime + 3 * 60 * 60 * 1000)) { if (Date.now() < ($.farmTask.waterRainInit.lastTime + 3 * 60 * 60 * 1000)) {
executeWaterRain = false; executeWaterRain = false;
// message += `【第${$.farmTask.waterRainInit.winTimes + 1}次水滴雨】未到时间,请${new Date($.farmTask.waterRainInit.lastTime + 3 * 60 * 60 * 1000).toLocaleTimeString()}再试\n`; // message += `【第${$.farmTask.waterRainInit.winTimes + 1}次水滴雨】未到时间,请${new Date($.farmTask.waterRainInit.lastTime + 3 * 60 * 60 * 1000).toLocaleTimeString()}再试\n`;
console.log(`\`【第${$.farmTask.waterRainInit.winTimes + 1}次水滴雨】未到时间,请${new Date($.farmTask.waterRainInit.lastTime + 3 * 60 * 60 * 1000).toLocaleTimeString()}再试\n`); console.log(`【第${$.farmTask.waterRainInit.winTimes + 1}次水滴雨】未到时间,请${new Date($.farmTask.waterRainInit.lastTime + 3 * 60 * 60 * 1000).toLocaleTimeString()}再试\n`);
} }
} }
if (executeWaterRain) { if (executeWaterRain) {
@@ -1032,18 +1113,44 @@ async function duck() {
} }
} }
async function GetCollect() { async function GetCollect() {
try { try {
await initForFarm(); console.log(`\n【京东账号${$.index}${$.UserName})的${$.name}好友互助码】`);
if ($.farmInfo.farmUserPro) { var llfound = false;
console.log(`\n【京东账号${$.index}${$.UserName})的${$.name}好友互助码】${$.farmInfo.farmUserPro.shareCode}`); var strShareCode = "";
newShareCodes.push($.farmInfo.farmUserPro.shareCode) if (TempShareCache) {
} else { for (let j = 0; j < TempShareCache.length; j++) {
console.log(`\n【京东账号${$.index}${$.UserName})的${$.name}好友互助码】\n数据异常,使用ccwav的互助码:f910ae66879a422daeb32f9250fc5e2e`); if (TempShareCache[j].pt_pin == $.UserName) {
newShareCodes.push("f910ae66879a422daeb32f9250fc5e2e"); llfound = true;
strShareCode = TempShareCache[j].ShareCode;
}
}
}
if (!llfound) {
console.log($.UserName + "该账号无缓存,尝试联网获取互助码.....");
llgetshare=true;
await initForFarm();
if ($.farmInfo.farmUserPro) {
var tempAddCK = {};
strShareCode=$.farmInfo.farmUserPro.shareCode;
tempAddCK = {
"pt_pin": $.UserName,
"ShareCode": strShareCode
};
TempShareCache.push(tempAddCK);
//标识,需要更新缓存文件
boolneedUpdate = true;
}
}
if (strShareCode) {
console.log(`\n`+strShareCode);
newShareCodes.push(strShareCode)
} else {
console.log(`\n数据异常`);
}
} catch (e) {
$.logErr(e);
} }
} catch (e) {
$.logErr(e);
}
} }
// ========================API调用接口======================== // ========================API调用接口========================
//鸭子,点我有惊喜 //鸭子,点我有惊喜
@@ -1053,7 +1160,7 @@ async function getFullCollectionReward() {
$.post(taskUrl("getFullCollectionReward", body), (err, resp, data) => { $.post(taskUrl("getFullCollectionReward", body), (err, resp, data) => {
try { try {
if (err) { if (err) {
console.log('\n东东农场: API查询请求失败 ‼️‼️'); console.log('\ngetFullCollectionReward: API查询请求失败 ‼️‼️');
console.log(JSON.stringify(err)); console.log(JSON.stringify(err));
$.logErr(err); $.logErr(err);
} else { } else {
@@ -1107,8 +1214,8 @@ async function gotStageAwardForFarm(type) {
} }
//浇水API //浇水API
async function waterGoodForFarm() { async function waterGoodForFarm() {
await $.wait(1000); await $.wait(2000);
console.log('等待了1秒'); console.log('等待了2秒');
const functionId = arguments.callee.name.toString(); const functionId = arguments.callee.name.toString();
$.waterResult = await request(functionId); $.waterResult = await request(functionId);
@@ -1118,8 +1225,8 @@ async function initForTurntableFarm() {
$.initForTurntableFarmRes = await request(arguments.callee.name.toString(), { version: 4, channel: 1 }); $.initForTurntableFarmRes = await request(arguments.callee.name.toString(), { version: 4, channel: 1 });
} }
async function lotteryForTurntableFarm() { async function lotteryForTurntableFarm() {
await $.wait(2000); await $.wait(3000);
console.log('等待了2秒'); console.log('等待了3秒');
$.lotteryRes = await request(arguments.callee.name.toString(), { type: 1, version: 4, channel: 1 }); $.lotteryRes = await request(arguments.callee.name.toString(), { type: 1, version: 4, channel: 1 });
} }
@@ -1302,13 +1409,13 @@ async function initForFarm() {
}; };
$.post(option, (err, resp, data) => { $.post(option, (err, resp, data) => {
try { try {
if (err) { if (err) {
console.log('\n东东农场: API查询请求失败 ‼️‼️'); console.log('\ninitForFarm: API查询请求失败 ‼️‼️');
console.log(JSON.stringify(err)); console.log(JSON.stringify(err));
$.logErr(err); $.logErr(err);
} else { } else {
if (safeGet(data)) { if (safeGet(data)) {
$.farmInfo = JSON.parse(data) $.farmInfo = JSON.parse(data)
} }
} }
} catch (e) { } catch (e) {
@@ -1438,7 +1545,7 @@ function request(function_id, body = {}, timeout = 1000) {
$.get(taskUrl(function_id, body), (err, resp, data) => { $.get(taskUrl(function_id, body), (err, resp, data) => {
try { try {
if (err) { if (err) {
console.log('\n东东农场: API查询请求失败 ‼️‼️') console.log('\nrequest: API查询请求失败 ‼️‼️')
console.log(JSON.stringify(err)); console.log(JSON.stringify(err));
console.log(`function_id:${function_id}`) console.log(`function_id:${function_id}`)
$.logErr(err); $.logErr(err);

View File

@@ -57,7 +57,17 @@ if ($.isNode() && process.env.CC_NOHELPAFTER8) {
} }
} }
} }
let WP_APP_TOKEN_ONE = "";
if ($.isNode()) {
if (process.env.WP_APP_TOKEN_ONE) {
WP_APP_TOKEN_ONE = process.env.WP_APP_TOKEN_ONE;
}
}
if(WP_APP_TOKEN_ONE)
console.log(`检测到已配置Wxpusher的Token启用一对一推送...`);
else
console.log(`检测到未配置Wxpusher的Token禁用一对一推送...`);
console.log(`${cookiesArr.length}个京东账号\n`); console.log(`${cookiesArr.length}个京东账号\n`);
!(async() => { !(async() => {
@@ -166,6 +176,9 @@ async function jdPet() {
if ($.isNode()) { if ($.isNode()) {
await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName || $.UserName}奖品已可领取`, `京东账号${$.index} ${$.nickName || $.UserName}\n${$.petInfo.goodsInfo.goodsName}已可领取`); await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName || $.UserName}奖品已可领取`, `京东账号${$.index} ${$.nickName || $.UserName}\n${$.petInfo.goodsInfo.goodsName}已可领取`);
} }
if ($.isNode() && WP_APP_TOKEN_ONE) {
await notify.sendNotifybyWxPucher($.name, `【提醒⏰】${$.petInfo.goodsInfo.goodsName}已可领取\n【领取步骤】京东->我的->东东萌宠兑换京东红包,可以用于京东app的任意商品.`, `${$.UserName}`);
}
return return
} else if ($.petInfo.petStatus === 6) { } else if ($.petInfo.petStatus === 6) {
await slaveHelp(); //已领取红包,但未领养新的,也能继续助力好友 await slaveHelp(); //已领取红包,但未领养新的,也能继续助力好友
@@ -174,6 +187,7 @@ async function jdPet() {
if ($.isNode()) { if ($.isNode()) {
await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName || $.UserName}奖品已可领取`, `京东账号${$.index} ${$.nickName || $.UserName}\n已领取红包,但未继续领养新的物品`); await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName || $.UserName}奖品已可领取`, `京东账号${$.index} ${$.nickName || $.UserName}\n已领取红包,但未继续领养新的物品`);
} }
return return
} }
//console.log(`\n【京东账号${$.index}${$.UserName})的${$.name}好友互助码】${$.petInfo.shareCode}\n`); //console.log(`\n【京东账号${$.index}${$.UserName})的${$.name}好友互助码】${$.petInfo.shareCode}\n`);