更新农场

KingRan 2022-02-24 17:07:48 +08:00
parent 6038e701b0
commit cd6c1069a1
3 changed files with 258 additions and 149 deletions

View File

@ -10,19 +10,17 @@
==========================Quantumultx========================= ==========================Quantumultx=========================
[task_local] [task_local]
#jd免费水果 #jd免费水果
10 5,17 * * * jd_fruit_friend.js, tag=东东农场好友删减奖励, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jdnc.png, enabled=true 10 2 * * * jd_fruit_friend.js, tag=东东农场好友删减奖励, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jdnc.png, enabled=true
=========================Loon============================= =========================Loon=============================
[Script] [Script]
cron "10 5,17 * * *" script-path=jd_fruit_friend.js,tag=东东农场好友删减奖励 cron "10 2 * * *" script-path=jd_fruit_friend.js,tag=东东农场好友删减奖励
=========================Surge============================ =========================Surge============================
东东农场好友删减奖励 = type=cron,cronexp="10 5,17 * * *",wake-system=1,timeout=3600,script-path=jd_fruit_friend.js 东东农场好友删减奖励 = type=cron,cronexp="10 2 * * *",wake-system=1,timeout=3600,script-path=jd_fruit_friend.js
=========================小火箭=========================== =========================小火箭===========================
东东农场好友删减奖励 = type=cron,script-path=jd_fruit_friend.js, cronexpr="10 5,17 * * *", timeout=3600, enable=true 东东农场好友删减奖励 = type=cron,script-path=jd_fruit_friend.js, cronexpr="10 2 * * *", timeout=3600, enable=true
每号间隔毫秒默认0毫秒0分钟
export fruit_sleep=20000
*/ */
const $ = new Env('东东农场好友删减奖励'); const $ = new Env('东东农场好友删减奖励');
@ -35,7 +33,22 @@ let jdFruitBeanCard = false;//农场使用水滴换豆卡(如果出现限时活
const JD_API_HOST = 'https://api.m.jd.com/client.action'; 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;
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 lnrun = 0;
let llgetshare = false;
!(async () => { !(async () => {
await requireConfig(); await requireConfig();
if (!cookiesArr[0]) { if (!cookiesArr[0]) {
@ -43,60 +56,83 @@ let llhelp=true;
return; return;
} }
if(llhelp){ if(llhelp){
console.log('开始收集您的互助码,用于好友删除与加好友操作'); console.log('\n【开始收集您的互助码,用于好友删除与加好友操作】\n');
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 $.wait(1500); await GetCollect();
} if(llgetshare){
} await $.wait(5000);
} lnrun++;
for (let i = 0; i < cookiesArr.length; i++) { }
if (cookiesArr[i]) { if(lnrun == 10){
cookie = cookiesArr[i]; console.log(`\n【访问接口次数达到10次休息一分钟.....】\n`);
$.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]) await $.wait(60*1000);
$.index = i + 1; lnrun = 0;
$.isLogin = true; }
$.nickName = ''; }
await TotalBean(); }
console.log(`\n开始【京东账号${$.index}${$.nickName || $.UserName}\n`); if (boolneedUpdate) {
if (!$.isLogin) { var str = JSON.stringify(TempShareCache, null, 2);
$.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" }); fs.writeFile(strShare, str, function (err) {
if (err) {
if ($.isNode()) { console.log(err);
await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`); console.log("\n【缓存文件Fruit_ShareCache.json更新失败!】\n");
} } else {
continue console.log("\n【缓存文件Fruit_ShareCache.json更新成功!】\n");
}
})
} }
message = '';
subTitle = '';
option = {};
$.retry = 0;
await jdFruit();
await $.wait(30 * 1000);
}
if ($.isNode()) {
process.env.fruit_sleep ? await $.wait(Number(process.env.fruit_sleep)) : ''
}
} }
console.log('\n【互助码已经收集完毕现在开始账号内部互助请稍等...】\n');
for (let i = 0; i < cookiesArr.length; i++) {
if (cookiesArr[i]) {
cookie = cookiesArr[i];
$.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1])
$.index = i + 1;
$.isLogin = true;
$.nickName = '';
await TotalBean();
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" });
if ($.isNode()) {
await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`);
}
continue
}
message = '';
subTitle = '';
option = {};
$.retry = 0;
lnrun++;
await jdFruit();
if (lnrun == 5) {
console.log(`\n【访问接口次数达到5次休息一分钟.....】\n`);
await $.wait(60 * 1000);
lnrun = 0;
}
}
}
if ($.isNode() && allMessage && $.ctrTemp) { if ($.isNode() && allMessage && $.ctrTemp) {
await notify.sendNotify(`${$.name}`, `${allMessage}`) await notify.sendNotify(`${$.name}`, `${allMessage}`)
} }
@ -172,18 +208,44 @@ async function receiveFriendInvite() {
} }
} }
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数据异常,使用作者的互助码:94f3ba0769b04c94bbfca26139108702`); if (TempShareCache[j].pt_pin == $.UserName) {
newShareCodes.push("94f3ba0769b04c94bbfca26139108702"); 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调用接口========================
//鸭子,点我有惊喜 //鸭子,点我有惊喜
@ -572,7 +634,7 @@ function TotalBean() {
}) })
}) })
} }
function request(function_id, body = {}, timeout = 1000) { function request(function_id, body = {}, timeout = 2000) {
return new Promise(resolve => { return new Promise(resolve => {
setTimeout(() => { setTimeout(() => {
$.get(taskUrl(function_id, body), (err, resp, data) => { $.get(taskUrl(function_id, body), (err, resp, data) => {

View File

@ -23,9 +23,6 @@ cron "20 4,16 * * *" script-path=jd_fruit_help.js,tag=东东农场内部互助
export DO_TEN_WATER_AGAIN="" 默认再次浇水 export DO_TEN_WATER_AGAIN="" 默认再次浇水
每号间隔毫秒默认0毫秒0分钟
export fruit_sleep=20000
*/ */
const $ = new Env('东东农场内部水滴互助'); const $ = new Env('东东农场内部水滴互助');
let cookiesArr = [], let cookiesArr = [],
@ -54,7 +51,22 @@ let randomCount = $.isNode() ? 20 : 5;
const JD_API_HOST = 'https://api.m.jd.com/client.action'; 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;
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 lnrun = 0;
let llgetshare = false;
!(async() => { !(async() => {
await requireConfig(); await requireConfig();
if (!cookiesArr[0]) { if (!cookiesArr[0]) {
@ -62,7 +74,7 @@ let llhelp=true;
return; return;
} }
if(llhelp){ if(llhelp){
console.log('开始收集您的互助码,用于账号内部互助,请稍等...'); console.log('\n【开始收集您的互助码,用于账号内部互助,请稍等...】\n');
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];
@ -74,20 +86,41 @@ let llhelp=true;
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 $.wait(1500); await GetCollect();
} if(llgetshare){
} await $.wait(5000);
} lnrun++;
}
if(lnrun == 10){
console.log(`\n【访问接口次数达到10次休息一分钟.....】\n`);
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("\n【缓存文件Fruit_ShareCache.json更新失败!】\n");
} else {
console.log("\n【缓存文件Fruit_ShareCache.json更新成功!】\n");
}
})
}
}
console.log('\n【互助码已经收集完毕现在开始账号内部互助请稍等...】\n');
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];
@ -109,12 +142,14 @@ let llhelp=true;
subTitle = ''; subTitle = '';
option = {}; option = {};
$.retry = 0; $.retry = 0;
await jdFruit(); lnrun++;
await $.wait(20 * 1000); await jdFruit();
if (lnrun == 5) {
console.log(`\n【访问接口次数达到5次休息一分钟.....】\n`);
await $.wait(60 * 1000);
lnrun = 0;
}
} }
if ($.isNode()) {
process.env.fruit_sleep ? await $.wait(Number(process.env.fruit_sleep)) : ''
}
} }
if ($.isNode() && allMessage && $.ctrTemp) { if ($.isNode() && allMessage && $.ctrTemp) {
await notify.sendNotify(`${$.name}`, `${allMessage}`) await notify.sendNotify(`${$.name}`, `${allMessage}`)
@ -231,7 +266,7 @@ async function turntableFarm() {
} }
//助力好友 //助力好友
async function masterHelpShare() { async function masterHelpShare() {
await $.wait(2000);
await initForFarm(); await initForFarm();
let salveHelpAddWater = 0; let salveHelpAddWater = 0;
let remainTimes = 3;//今日剩余助力次数,默认3次京东农场每人每天3次助力机会 let remainTimes = 3;//今日剩余助力次数,默认3次京东农场每人每天3次助力机会
@ -250,7 +285,6 @@ async function masterHelpShare() {
continue continue
} }
await masterHelp(code); await masterHelp(code);
await $.wait(2000);
if ($.helpResult.code === '0') { if ($.helpResult.code === '0') {
if ($.helpResult.helpResult.code === '0') { if ($.helpResult.helpResult.code === '0') {
//助力成功 //助力成功
@ -306,18 +340,46 @@ async function masterHelpShare() {
} }
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数据异常`); if (TempShareCache[j].pt_pin == $.UserName) {
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调用接口========================
//鸭子,点我有惊喜 //鸭子,点我有惊喜
async function getFullCollectionReward() { async function getFullCollectionReward() {
@ -708,7 +770,7 @@ function TotalBean() {
}) })
} }
function request(function_id, body = {}, timeout = 1000) { function request(function_id, body = {}, timeout = 2000) {
return new Promise(resolve => { return new Promise(resolve => {
setTimeout(() => { setTimeout(() => {
$.get(taskUrl(function_id, body), (err, resp, data) => { $.get(taskUrl(function_id, body), (err, resp, data) => {

View File

@ -23,9 +23,6 @@ cron "5 6-18/6 * * *" script-path=jd_fruit_task.js,tag=东东农场日常任务
export DO_TEN_WATER_AGAIN="" 默认再次浇水 export DO_TEN_WATER_AGAIN="" 默认再次浇水
每号间隔毫秒默认0毫秒0分钟
export fruit_sleep=20000
*/ */
const $ = new Env('东东农场日常任务'); const $ = new Env('东东农场日常任务');
let cookiesArr = [], let cookiesArr = [],
@ -52,8 +49,9 @@ let jdFruitBeanCard = false; //农场使用水滴换豆卡(如果出现限时活
let randomCount = $.isNode() ? 20 : 5; let randomCount = $.isNode() ? 20 : 5;
const JD_API_HOST = 'https://api.m.jd.com/client.action'; 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 lnrun = 0;
!(async() => { !(async() => {
await requireConfig(); await requireConfig();
if (!cookiesArr[0]) { if (!cookiesArr[0]) {
$.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;
@ -79,13 +77,15 @@ const urlSchema = `openjd://virtual?params=%7B%20%22category%22:%20%22jump%22,%2
subTitle = ''; subTitle = '';
option = {}; option = {};
$.retry = 0; $.retry = 0;
//await shareCodesFormat(); lnrun++;
await jdFruit(); await jdFruit();
if (lnrun == 3) {
console.log(`\n【访问接口次数达到3次休息一分钟.....】\n`);
await $.wait(60 * 1000);
lnrun = 0;
}
await $.wait(30 * 1000); await $.wait(30 * 1000);
} }
if ($.isNode()) {
process.env.fruit_sleep ? await $.wait(Number(process.env.fruit_sleep)) : ''
}
} }
if ($.isNode() && allMessage && $.ctrTemp) { if ($.isNode() && allMessage && $.ctrTemp) {
await notify.sendNotify(`${$.name}`, `${allMessage}`) await notify.sendNotify(`${$.name}`, `${allMessage}`)
@ -1207,42 +1207,27 @@ function timeFormat(time) {
} }
return date.getFullYear() + '-' + ((date.getMonth() + 1) >= 10 ? (date.getMonth() + 1) : '0' + (date.getMonth() + 1)) + '-' + (date.getDate() >= 10 ? date.getDate() : '0' + date.getDate()); return date.getFullYear() + '-' + ((date.getMonth() + 1) >= 10 ? (date.getMonth() + 1) : '0' + (date.getMonth() + 1)) + '-' + (date.getDate() >= 10 ? date.getDate() : '0' + date.getDate());
} }
function requireConfig() { function requireConfig() {
return new Promise(resolve => { return new Promise(resolve => {
console.log('开始获取配置文件\n') console.log('开始获取配置文件\n')
notify = $.isNode() ? require('./sendNotify') : ''; notify = $.isNode() ? require('./sendNotify') : '';
//Node.js用户请在jdCookie.js处填写京东ck; //Node.js用户请在jdCookie.js处填写京东ck;
const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
const jdFruitShareCodes = $.isNode() ? require('./jdFruitShareCodes.js') : ''; //IOS等用户直接用NobyDa的jd cookie
//IOS等用户直接用NobyDa的jd cookie if ($.isNode()) {
if ($.isNode()) { Object.keys(jdCookieNode).forEach((item) => {
Object.keys(jdCookieNode).forEach((item) => { if (jdCookieNode[item]) {
if (jdCookieNode[item]) { cookiesArr.push(jdCookieNode[item])
cookiesArr.push(jdCookieNode[item])
}
})
if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {};
} else {
cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item);
} }
console.log(`${cookiesArr.length}个京东账号\n`) })
$.shareCodesArr = []; if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => { };
if ($.isNode()) { } else {
Object.keys(jdFruitShareCodes).forEach((item) => { cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item);
if (jdFruitShareCodes[item]) { }
$.shareCodesArr.push(jdFruitShareCodes[item]) console.log(`${cookiesArr.length}个京东账号\n`)
} $.shareCodesArr = [];
}) resolve()
} else { })
if ($.getdata('jd_fruit_inviter')) $.shareCodesArr = $.getdata('jd_fruit_inviter').split('\n').filter(item => !!item);
console.log(`\nBoxJs设置的${$.name}好友邀请码:${$.getdata('jd_fruit_inviter') ? $.getdata('jd_fruit_inviter') : '暂无'}\n`);
}
// console.log(`$.shareCodesArr::${JSON.stringify($.shareCodesArr)}`)
// console.log(`jdFruitShareArr账号长度::${$.shareCodesArr.length}`)
// console.log(`您提供了${$.shareCodesArr.length}个账号的农场助力码\n`);
resolve()
})
} }
function TotalBean() { function TotalBean() {