mirror of
https://github.com/shufflewzc/faker2.git
synced 2025-05-06 03:53:48 +08:00
update
This commit is contained in:
parent
fe71d16d00
commit
0feea70e8b
@ -29,8 +29,8 @@ const token = [
|
|||||||
"4BE1B58FE1360409A5967CAD1127B5A8",
|
"4BE1B58FE1360409A5967CAD1127B5A8",
|
||||||
"DBD58C7DDEB7D5EE3E99C164755C0BEE",
|
"DBD58C7DDEB7D5EE3E99C164755C0BEE",
|
||||||
"3B27B2B9E70249C339D66F27B7E133F0",
|
"3B27B2B9E70249C339D66F27B7E133F0",
|
||||||
"70E81DD8CF06D043FE1FD2DB60B59987",
|
"83E3C2227A9EEF3CC3A427DD79CB9902",
|
||||||
"572B5331C2303ABFF034700EDDFE2B41",
|
"CA62BF5DC17D2B1427EAEA0C7A1215C7",
|
||||||
"979F3F329012E8BE0D64DA1B7D6F024B",
|
"979F3F329012E8BE0D64DA1B7D6F024B",
|
||||||
"1C963AA3BBBD0396784BD0CA527BCDF8",
|
"1C963AA3BBBD0396784BD0CA527BCDF8",
|
||||||
"C5FD1482A207F2CC65570F8FBC492C9A",
|
"C5FD1482A207F2CC65570F8FBC492C9A",
|
||||||
@ -47,7 +47,7 @@ const token = [
|
|||||||
"7D7E23BB728C9D7425C776BDC8943D10",
|
"7D7E23BB728C9D7425C776BDC8943D10",
|
||||||
"9F75D813CBE3D1F9B146F002FEA4FF2D",
|
"9F75D813CBE3D1F9B146F002FEA4FF2D",
|
||||||
"CCB11192ED79F4AF11EABBD732B26874",
|
"CCB11192ED79F4AF11EABBD732B26874",
|
||||||
"85B78F013645D1EC53D5F3974528654A"
|
"CA62BF5DC17D2B1427EAEA0C7A1215C7"
|
||||||
]
|
]
|
||||||
|
|
||||||
if ($.isNode()) {
|
if ($.isNode()) {
|
||||||
|
540
jd_lzdz1_customized613.js
Normal file
540
jd_lzdz1_customized613.js
Normal file
File diff suppressed because one or more lines are too long
174
jd_plantBean.js
174
jd_plantBean.js
@ -1,28 +1,29 @@
|
|||||||
/*
|
/*
|
||||||
种豆得豆 脚本更新地址:https://raw.githubusercontent.com/Aaron-lv/sync/jd_scripts/jd_plantBean.js
|
种豆得豆 脚本更新地址:jd_plantBean.js
|
||||||
更新时间:2021-04-9
|
更新时间:2021-08-20
|
||||||
活动入口:京东APP我的-更多工具-种豆得豆
|
活动入口:京东APP我的-更多工具-种豆得豆
|
||||||
已支持IOS京东多账号,云端多京东账号
|
已支持IOS京东多账号,云端多京东账号
|
||||||
脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
|
脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
|
||||||
注:会自动关注任务中的店铺跟商品,介意者勿使用。
|
注:会自动关注任务中的店铺跟商品,介意者勿使用。
|
||||||
互助码shareCode请先手动运行脚本查看打印可看到
|
互助码shareCode请先手动运行脚本查看打印可看到
|
||||||
每个京东账号每天只能帮助3个人。多出的助力码将会助力失败。
|
每个京东账号每天只能帮助3个人。多出的助力码将会助力失败。
|
||||||
|
|
||||||
=====================================Quantumult X=================================
|
=====================================Quantumult X=================================
|
||||||
[task_local]
|
[task_local]
|
||||||
1 7-21/2 * * * https://raw.githubusercontent.com/Aaron-lv/sync/jd_scripts/jd_plantBean.js, tag=种豆得豆, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jdzd.png, enabled=true
|
1 7-21/2 * * * https://raw.githubusercontent.com/shufflewzc/faker2/main/jd_plantBean.js, tag=种豆得豆, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jdzd.png, enabled=true
|
||||||
|
|
||||||
=====================================Loon================================
|
=====================================Loon================================
|
||||||
[Script]
|
[Script]
|
||||||
cron "1 7-21/2 * * *" script-path=https://raw.githubusercontent.com/Aaron-lv/sync/jd_scripts/jd_plantBean.js,tag=京东种豆得豆
|
cron "1 7-21/2 * * *" script-path=https://raw.githubusercontent.com/shufflewzc/faker2/main/jd_plantBean.js,tag=京东种豆得豆
|
||||||
|
|
||||||
======================================Surge==========================
|
======================================Surge==========================
|
||||||
京东种豆得豆 = type=cron,cronexp="1 7-21/2 * * *",wake-system=1,timeout=3600,script-path=https://raw.githubusercontent.com/Aaron-lv/sync/jd_scripts/jd_plantBean.js
|
京东种豆得豆 = type=cron,cronexp="1 7-21/2 * * *",wake-system=1,timeout=3600,script-path=https://raw.githubusercontent.com/shufflewzc/faker2/main/jd_plantBean.js
|
||||||
|
|
||||||
====================================小火箭=============================
|
====================================小火箭=============================
|
||||||
京东种豆得豆 = type=cron,script-path=https://raw.githubusercontent.com/Aaron-lv/sync/jd_scripts/jd_plantBean.js, cronexpr="1 7-21/2 * * *", timeout=3600, enable=true
|
京东种豆得豆 = type=cron,script-path=https://raw.githubusercontent.com/shufflewzc/faker2/main/jd_plantBean.js, cronexpr="1 7-21/2 * * *", timeout=3600, enable=true
|
||||||
|
|
||||||
*/
|
*/
|
||||||
const $ = new Env('京东种豆得豆');
|
const $ = new Env('种豆得豆');
|
||||||
//Node.js用户请在jdCookie.js处填写京东ck;
|
//Node.js用户请在jdCookie.js处填写京东ck;
|
||||||
//ios等软件用户直接用NobyDa的jd cookie
|
//ios等软件用户直接用NobyDa的jd cookie
|
||||||
let jdNotify = true;//是否开启静默运行。默认true开启
|
let jdNotify = true;//是否开启静默运行。默认true开启
|
||||||
@ -32,12 +33,7 @@ const JD_API_HOST = 'https://api.m.jd.com/client.action';
|
|||||||
//助力好友分享码(最多3个,否则后面的助力失败)
|
//助力好友分享码(最多3个,否则后面的助力失败)
|
||||||
//此此内容是IOS用户下载脚本到本地使用,填写互助码的地方,同一京东账号的好友互助码请使用@符号隔开。
|
//此此内容是IOS用户下载脚本到本地使用,填写互助码的地方,同一京东账号的好友互助码请使用@符号隔开。
|
||||||
//下面给出两个账号的填写示例(iOS只支持2个京东账号)
|
//下面给出两个账号的填写示例(iOS只支持2个京东账号)
|
||||||
let shareCodes = [ // IOS本地脚本用户这个列表填入你要助力的好友的shareCode
|
let shareCodes = []
|
||||||
//账号一的好友shareCode,不同好友的shareCode中间用@符号隔开
|
|
||||||
'lsvcdmfjrraodhrrvhcfiz7iye@o7eiltak46s2x3mao6ugdiywqv6t56rymtxfe4q@e7lhibzb3zek2zegsqjmjagw4c3zvnit3ipzuci@olmijoxgmjuty7323i6ijrv5tdhd32kefogty5i@gf2njfitdloxldekzam2flrji4@mq65ksgdrkobhiyvkoqfi7ff7i5ac3f4ijdgqji@wkmb7lejrmax2avk7bszvx7s74@4npkonnsy7xi3acvl3goi4ga5gpmpv2km4yj3di@rj7s6mzlk7uognpgua34bszhyf4cpqqtj5vfhta@olmijoxgmjutyif5p35uuja6gwp2ulsp2x6fjoi@dzfuhp3b2fz7mnj5ndxxqsradgg5bsrhuof2mbq',
|
|
||||||
//账号二的好友shareCode,不同好友的shareCode中间用@符号隔开
|
|
||||||
'lsvcdmfjrraodhrrvhcfiz7iye@o7eiltak46s2x3mao6ugdiywqv6t56rymtxfe4q@e7lhibzb3zek2zegsqjmjagw4c3zvnit3ipzuci@olmijoxgmjuty7323i6ijrv5tdhd32kefogty5i@gf2njfitdloxldekzam2flrji4@mq65ksgdrkobhiyvkoqfi7ff7i5ac3f4ijdgqji@wkmb7lejrmax2avk7bszvx7s74@4npkonnsy7xi3acvl3goi4ga5gpmpv2km4yj3di@rj7s6mzlk7uognpgua34bszhyf4cpqqtj5vfhta@olmijoxgmjutyif5p35uuja6gwp2ulsp2x6fjoi@dzfuhp3b2fz7mnj5ndxxqsradgg5bsrhuof2mbq',
|
|
||||||
]
|
|
||||||
let allMessage = ``;
|
let allMessage = ``;
|
||||||
let currentRoundId = null;//本期活动id
|
let currentRoundId = null;//本期活动id
|
||||||
let lastRoundId = null;//上期id
|
let lastRoundId = null;//上期id
|
||||||
@ -45,6 +41,10 @@ let roundList = [];
|
|||||||
let awardState = '';//上期活动的京豆是否收取
|
let awardState = '';//上期活动的京豆是否收取
|
||||||
let randomCount = $.isNode() ? 20 : 5;
|
let randomCount = $.isNode() ? 20 : 5;
|
||||||
let num;
|
let num;
|
||||||
|
let llerror=false;
|
||||||
|
$.newShareCode = [];
|
||||||
|
let NowHour = new Date().getHours();
|
||||||
|
let lnrun = 0;
|
||||||
!(async () => {
|
!(async () => {
|
||||||
await requireConfig();
|
await requireConfig();
|
||||||
if (!cookiesArr[0]) {
|
if (!cookiesArr[0]) {
|
||||||
@ -71,9 +71,14 @@ let num;
|
|||||||
message = '';
|
message = '';
|
||||||
subTitle = '';
|
subTitle = '';
|
||||||
option = {};
|
option = {};
|
||||||
await shareCodesFormat();
|
lnrun++;
|
||||||
await jdPlantBean();
|
await jdPlantBean();
|
||||||
await showMsg();
|
if(lnrun == 3){
|
||||||
|
console.log(`\n【访问接口次数达到3次,休息一分钟.....】\n`);
|
||||||
|
await $.wait(60*1000);
|
||||||
|
lnrun = 0;
|
||||||
|
}
|
||||||
|
//await showMsg();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($.isNode() && allMessage) {
|
if ($.isNode() && allMessage) {
|
||||||
@ -89,22 +94,21 @@ async function jdPlantBean() {
|
|||||||
try {
|
try {
|
||||||
console.log(`获取任务及基本信息`)
|
console.log(`获取任务及基本信息`)
|
||||||
await plantBeanIndex();
|
await plantBeanIndex();
|
||||||
if ($.plantBeanIndexResult.errorCode === 'PB101') {
|
if(llerror)
|
||||||
console.log(`\n活动太火爆了,还是去买买买吧!\n`)
|
return;
|
||||||
return
|
|
||||||
}
|
|
||||||
if ($.plantBeanIndexResult && $.plantBeanIndexResult.code === '0' && $.plantBeanIndexResult.data) {
|
|
||||||
// console.log(plantBeanIndexResult.data.taskList);
|
|
||||||
for (let i = 0; i < $.plantBeanIndexResult.data.roundList.length; i++) {
|
for (let i = 0; i < $.plantBeanIndexResult.data.roundList.length; i++) {
|
||||||
if ($.plantBeanIndexResult.data.roundList[i].roundState === "2") {
|
if ($.plantBeanIndexResult.data.roundList[i].roundState === "2") {
|
||||||
num = i
|
num = i
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// console.log(plantBeanIndexResult.data.taskList);
|
||||||
|
if ($.plantBeanIndexResult && $.plantBeanIndexResult.code === '0' && $.plantBeanIndexResult.data) {
|
||||||
const shareUrl = $.plantBeanIndexResult.data.jwordShareInfo.shareUrl
|
const shareUrl = $.plantBeanIndexResult.data.jwordShareInfo.shareUrl
|
||||||
$.myPlantUuid = getParam(shareUrl, 'plantUuid')
|
$.myPlantUuid = getParam(shareUrl, 'plantUuid')
|
||||||
console.log(`\n【京东账号${$.index}(${$.UserName})的${$.name}好友互助码】${$.myPlantUuid}\n`);
|
console.log(`\n【京东账号${$.index}(${$.UserName})的${$.name}好友互助码】${$.myPlantUuid}\n`);
|
||||||
|
jdPlantBeanShareArr.push($.myPlantUuid)
|
||||||
|
|
||||||
roundList = $.plantBeanIndexResult.data.roundList;
|
roundList = $.plantBeanIndexResult.data.roundList;
|
||||||
currentRoundId = roundList[num].roundId;//本期的roundId
|
currentRoundId = roundList[num].roundId;//本期的roundId
|
||||||
lastRoundId = roundList[num - 1].roundId;//上期的roundId
|
lastRoundId = roundList[num - 1].roundId;//上期的roundId
|
||||||
@ -113,22 +117,29 @@ async function jdPlantBean() {
|
|||||||
subTitle = `【京东昵称】${$.plantBeanIndexResult.data.plantUserInfo.plantNickName}`;
|
subTitle = `【京东昵称】${$.plantBeanIndexResult.data.plantUserInfo.plantNickName}`;
|
||||||
message += `【上期时间】${roundList[num - 1].dateDesc.replace('上期 ', '')}\n`;
|
message += `【上期时间】${roundList[num - 1].dateDesc.replace('上期 ', '')}\n`;
|
||||||
message += `【上期成长值】${roundList[num - 1].growth}\n`;
|
message += `【上期成长值】${roundList[num - 1].growth}\n`;
|
||||||
|
await $.wait(1000);
|
||||||
await receiveNutrients();//定时领取营养液
|
await receiveNutrients();//定时领取营养液
|
||||||
await doHelp();//助力
|
await $.wait(2000);
|
||||||
await doTask();//做日常任务
|
await doTask();//做日常任务
|
||||||
|
await $.wait(5000);
|
||||||
// await doEgg();
|
// await doEgg();
|
||||||
await stealFriendWater();
|
await stealFriendWater();
|
||||||
|
await $.wait(2000);
|
||||||
await doCultureBean();
|
await doCultureBean();
|
||||||
|
await $.wait(1000);
|
||||||
await doGetReward();
|
await doGetReward();
|
||||||
|
await $.wait(1000);
|
||||||
await showTaskProcess();
|
await showTaskProcess();
|
||||||
|
await $.wait(1000);
|
||||||
await plantShareSupportList();
|
await plantShareSupportList();
|
||||||
|
await $.wait(1000);
|
||||||
} else {
|
} else {
|
||||||
console.log(`种豆得豆-初始失败: ${JSON.stringify($.plantBeanIndexResult)}`);
|
console.log(`种豆得豆-初始失败: ${JSON.stringify($.plantBeanIndexResult)}`);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
$.logErr(e);
|
$.logErr(e);
|
||||||
const errMsg = `京东账号${$.index} ${$.nickName || $.UserName}\n任务执行异常,请检查执行日志 ‼️‼️`;
|
const errMsg = `京东账号${$.index} ${$.nickName || $.UserName}\n任务执行异常,请检查执行日志 ‼️‼️`;
|
||||||
if ($.isNode()) await notify.sendNotify(`${$.name}`, errMsg);
|
// if ($.isNode()) await notify.sendNotify(`${$.name}`, errMsg);
|
||||||
$.msg($.name, '', `${errMsg}`)
|
$.msg($.name, '', `${errMsg}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -164,6 +175,8 @@ async function doGetReward() {
|
|||||||
}
|
}
|
||||||
async function doCultureBean() {
|
async function doCultureBean() {
|
||||||
await plantBeanIndex();
|
await plantBeanIndex();
|
||||||
|
if(llerror)
|
||||||
|
return;
|
||||||
if ($.plantBeanIndexResult && $.plantBeanIndexResult.code === '0' && $.plantBeanIndexResult.data) {
|
if ($.plantBeanIndexResult && $.plantBeanIndexResult.code === '0' && $.plantBeanIndexResult.data) {
|
||||||
const plantBeanRound = $.plantBeanIndexResult.data.roundList[num]
|
const plantBeanRound = $.plantBeanIndexResult.data.roundList[num]
|
||||||
if (plantBeanRound.roundState === '2') {
|
if (plantBeanRound.roundState === '2') {
|
||||||
@ -251,6 +264,7 @@ async function doTask() {
|
|||||||
console.log(`\n开始做 ${item.taskName}任务`);
|
console.log(`\n开始做 ${item.taskName}任务`);
|
||||||
// $.receiveNutrientsTaskRes = await receiveNutrientsTask(item.taskType);
|
// $.receiveNutrientsTaskRes = await receiveNutrientsTask(item.taskType);
|
||||||
await receiveNutrientsTask(item.taskType);
|
await receiveNutrientsTask(item.taskType);
|
||||||
|
await $.wait(3000);
|
||||||
console.log(`做 ${item.taskName}任务结果:${JSON.stringify($.receiveNutrientsTaskRes)}\n`);
|
console.log(`做 ${item.taskName}任务结果:${JSON.stringify($.receiveNutrientsTaskRes)}\n`);
|
||||||
}
|
}
|
||||||
if (item.taskType === 3) {
|
if (item.taskType === 3) {
|
||||||
@ -393,6 +407,8 @@ async function doTask() {
|
|||||||
function showTaskProcess() {
|
function showTaskProcess() {
|
||||||
return new Promise(async resolve => {
|
return new Promise(async resolve => {
|
||||||
await plantBeanIndex();
|
await plantBeanIndex();
|
||||||
|
if(llerror)
|
||||||
|
return;
|
||||||
if ($.plantBeanIndexResult && $.plantBeanIndexResult.code === '0' && $.plantBeanIndexResult.data) {
|
if ($.plantBeanIndexResult && $.plantBeanIndexResult.code === '0' && $.plantBeanIndexResult.data) {
|
||||||
$.taskList = $.plantBeanIndexResult.data.taskList;
|
$.taskList = $.plantBeanIndexResult.data.taskList;
|
||||||
if ($.taskList && $.taskList.length > 0) {
|
if ($.taskList && $.taskList.length > 0) {
|
||||||
@ -407,38 +423,7 @@ function showTaskProcess() {
|
|||||||
resolve()
|
resolve()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
//助力好友
|
|
||||||
async function doHelp() {
|
|
||||||
for (let plantUuid of newShareCodes) {
|
|
||||||
console.log(`开始助力京东账号${$.index} - ${$.nickName}的好友: ${plantUuid}`);
|
|
||||||
if (!plantUuid) continue;
|
|
||||||
if (plantUuid === $.myPlantUuid) {
|
|
||||||
console.log(`\n跳过自己的plantUuid\n`)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
await helpShare(plantUuid);
|
|
||||||
if ($.helpResult && $.helpResult.code === '0' && $.helpResult.data) {
|
|
||||||
// console.log(`助力好友结果: ${JSON.stringify($.helpResult.data.helpShareRes)}`);
|
|
||||||
if ($.helpResult.data.helpShareRes) {
|
|
||||||
if ($.helpResult.data.helpShareRes.state === '1') {
|
|
||||||
console.log(`助力好友${plantUuid}成功`)
|
|
||||||
console.log(`${$.helpResult.data.helpShareRes.promptText}\n`);
|
|
||||||
} else if ($.helpResult.data.helpShareRes.state === '2') {
|
|
||||||
console.log('您今日助力的机会已耗尽,已不能再帮助好友助力了\n');
|
|
||||||
break;
|
|
||||||
} else if ($.helpResult.data.helpShareRes.state === '3') {
|
|
||||||
console.log('该好友今日已满9人助力/20瓶营养液,明天再来为Ta助力吧\n')
|
|
||||||
} else if ($.helpResult.data.helpShareRes.state === '4') {
|
|
||||||
console.log(`${$.helpResult.data.helpShareRes.promptText}\n`)
|
|
||||||
} else {
|
|
||||||
console.log(`助力其他情况:${JSON.stringify($.helpResult.data.helpShareRes)}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
console.log(`助力好友失败: ${JSON.stringify($.helpResult)}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function showMsg() {
|
function showMsg() {
|
||||||
$.log(`\n${message}\n`);
|
$.log(`\n${message}\n`);
|
||||||
jdNotify = $.getdata('jdPlantBeanNotify') ? $.getdata('jdPlantBeanNotify') : jdNotify;
|
jdNotify = $.getdata('jdPlantBeanNotify') ? $.getdata('jdPlantBeanNotify') : jdNotify;
|
||||||
@ -548,58 +533,47 @@ async function helpShare(plantUuid) {
|
|||||||
console.log(`助力结果的code:${$.helpResult && $.helpResult.code}`);
|
console.log(`助力结果的code:${$.helpResult && $.helpResult.code}`);
|
||||||
}
|
}
|
||||||
async function plantBeanIndex() {
|
async function plantBeanIndex() {
|
||||||
|
llerror=false;
|
||||||
$.plantBeanIndexResult = await request('plantBeanIndex'); //plantBeanIndexBody
|
$.plantBeanIndexResult = await request('plantBeanIndex'); //plantBeanIndexBody
|
||||||
|
if ($.plantBeanIndexResult.errorCode === 'PB101') {
|
||||||
|
console.log(`\n活动太火爆了,还是去买买买吧!\n`)
|
||||||
|
llerror=true;
|
||||||
|
return
|
||||||
}
|
}
|
||||||
function readShareCode() {
|
if ($.plantBeanIndexResult.errorCode) {
|
||||||
return new Promise(async resolve => {
|
console.log(`获取任务及基本信息出错,10秒后重试\n`)
|
||||||
$.get({url: `http://transfer.nz.lu/bean`, timeout: 10000}, (err, resp, data) => {
|
await $.wait(10000);
|
||||||
try {
|
$.plantBeanIndexResult = await request('plantBeanIndex');
|
||||||
if (err) {
|
if ($.plantBeanIndexResult.errorCode === 'PB101') {
|
||||||
console.log(JSON.stringify(err))
|
console.log(`\n活动太火爆了,还是去买买买吧!\n`)
|
||||||
console.log(`${$.name} API请求失败,请检查网路重试`)
|
llerror=true;
|
||||||
} else {
|
return
|
||||||
if (data) {
|
|
||||||
console.log(`随机取个${randomCount}码放到您固定的互助码后面(不影响已有固定互助)`)
|
|
||||||
data = JSON.parse(data);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
if ($.plantBeanIndexResult.errorCode) {
|
||||||
$.logErr(e, resp)
|
console.log(`获取任务及基本信息出错,30秒后重试\n`)
|
||||||
} finally {
|
await $.wait(30000);
|
||||||
resolve(data);
|
$.plantBeanIndexResult = await request('plantBeanIndex');
|
||||||
|
if ($.plantBeanIndexResult.errorCode === 'PB101') {
|
||||||
|
console.log(`\n活动太火爆了,还是去买买买吧!\n`)
|
||||||
|
llerror=true;
|
||||||
|
return
|
||||||
}
|
}
|
||||||
})
|
|
||||||
await $.wait(15000);
|
|
||||||
resolve()
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
//格式化助力码
|
if ($.plantBeanIndexResult.errorCode) {
|
||||||
function shareCodesFormat() {
|
console.log(`获取任务及基本信息失败,活动异常,换个时间再试试吧....`)
|
||||||
return new Promise(async resolve => {
|
console.log("错误代码;" + $.plantBeanIndexResult.errorCode)
|
||||||
// console.log(`第${$.index}个京东账号的助力码:::${$.shareCodesArr[$.index - 1]}`)
|
llerror=true;
|
||||||
newShareCodes = [];
|
return
|
||||||
if ($.shareCodesArr[$.index - 1]) {
|
|
||||||
newShareCodes = $.shareCodesArr[$.index - 1].split('@');
|
|
||||||
} else {
|
|
||||||
console.log(`由于您第${$.index}个京东账号未提供shareCode,将采纳本脚本自带的助力码\n`)
|
|
||||||
const tempIndex = $.index > shareCodes.length ? (shareCodes.length - 1) : ($.index - 1);
|
|
||||||
newShareCodes = shareCodes[tempIndex].split('@');
|
|
||||||
}
|
}
|
||||||
const readShareCodeRes = await readShareCode();
|
|
||||||
if (readShareCodeRes && readShareCodeRes.code === 200) {
|
|
||||||
newShareCodes = [...new Set([...newShareCodes, ...(readShareCodeRes.data || [])])];
|
|
||||||
}
|
|
||||||
console.log(`第${$.index}个京东账号将要助力的好友${JSON.stringify(newShareCodes)}`)
|
|
||||||
resolve();
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
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 jdPlantBeanShareCodes = $.isNode() ? require('./jdPlantBeanShareCodes.js') : '';
|
const jdPlantBeanShareCodes = '';
|
||||||
//IOS等用户直接用NobyDa的jd cookie
|
//IOS等用户直接用NobyDa的jd cookie
|
||||||
if ($.isNode()) {
|
if ($.isNode()) {
|
||||||
Object.keys(jdCookieNode).forEach((item) => {
|
Object.keys(jdCookieNode).forEach((item) => {
|
||||||
@ -621,10 +595,10 @@ function requireConfig() {
|
|||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
if ($.getdata('jd_plantbean_inviter')) $.shareCodesArr = $.getdata('jd_plantbean_inviter').split('\n').filter(item => !!item);
|
if ($.getdata('jd_plantbean_inviter')) $.shareCodesArr = $.getdata('jd_plantbean_inviter').split('\n').filter(item => !!item);
|
||||||
console.log(`\nBoxJs设置的${$.name}好友邀请码:${$.getdata('jd_plantbean_inviter') ? $.getdata('jd_plantbean_inviter') : '暂无'}\n`);
|
//console.log(`\nBoxJs设置的${$.name}好友邀请码:${$.getdata('jd_plantbean_inviter') ? $.getdata('jd_plantbean_inviter') : '暂无'}\n`);
|
||||||
}
|
}
|
||||||
// console.log(`\n种豆得豆助力码::${JSON.stringify($.shareCodesArr)}`);
|
// console.log(`\n种豆得豆助力码::${JSON.stringify($.shareCodesArr)}`);
|
||||||
console.log(`您提供了${$.shareCodesArr.length}个账号的种豆得豆助力码\n`);
|
//console.log(`您提供了${$.shareCodesArr.length}个账号的种豆得豆助力码\n`);
|
||||||
resolve()
|
resolve()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -635,7 +609,7 @@ function requestGet(function_id, body = {}) {
|
|||||||
body["monitor_source"] = "plant_app_plant_index";
|
body["monitor_source"] = "plant_app_plant_index";
|
||||||
body["monitor_refer"] = "";
|
body["monitor_refer"] = "";
|
||||||
return new Promise(async resolve => {
|
return new Promise(async resolve => {
|
||||||
await $.wait(2000);
|
await $.wait(5000);
|
||||||
const option = {
|
const option = {
|
||||||
url: `${JD_API_HOST}?functionId=${function_id}&body=${escape(JSON.stringify(body))}&appid=ld`,
|
url: `${JD_API_HOST}?functionId=${function_id}&body=${escape(JSON.stringify(body))}&appid=ld`,
|
||||||
headers: {
|
headers: {
|
||||||
@ -713,7 +687,7 @@ function TotalBean() {
|
|||||||
}
|
}
|
||||||
function request(function_id, body = {}) {
|
function request(function_id, body = {}) {
|
||||||
return new Promise(async resolve => {
|
return new Promise(async resolve => {
|
||||||
await $.wait(2000);
|
await $.wait(5000);
|
||||||
$.post(taskUrl(function_id, body), (err, resp, data) => {
|
$.post(taskUrl(function_id, body), (err, resp, data) => {
|
||||||
try {
|
try {
|
||||||
if (err) {
|
if (err) {
|
||||||
@ -732,7 +706,7 @@ function request(function_id, body = {}){
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
function taskUrl(function_id, body) {
|
function taskUrl(function_id, body) {
|
||||||
body["version"] = "9.2.4.0";
|
body["version"] = "9.2.4.1";
|
||||||
body["monitor_source"] = "plant_app_plant_index";
|
body["monitor_source"] = "plant_app_plant_index";
|
||||||
body["monitor_refer"] = "";
|
body["monitor_refer"] = "";
|
||||||
return {
|
return {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user