This commit is contained in:
lxk0301
2021-03-10 10:31:24 +08:00
parent f9615f5698
commit d3c85a0beb

View File

@@ -605,18 +605,58 @@ function getCFD(showInvite = true) {
}); });
}); });
} }
//领现金
function getJdCash() {
function taskUrl(functionId, body = {}) {
return {
url: `https://api.m.jd.com/client.action?functionId=${functionId}&body=${escape(JSON.stringify(body))}&appid=CashRewardMiniH5Env&appid=9.1.0`,
headers: {
'Cookie': cookie,
'Host': 'api.m.jd.com',
'Connection': 'keep-alive',
'Content-Type': 'application/json',
'Referer': 'http://wq.jd.com/wxapp/pages/hd-interaction/index/index',
'User-Agent': $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0"),
'Accept-Language': 'zh-cn',
'Accept-Encoding': 'gzip, deflate, br',
}
}
}
return new Promise((resolve) => {
$.get(taskUrl("cash_mob_home",), async (err, resp, data) => {
try {
if (err) {
console.log(`${JSON.stringify(err)}`)
console.log(`${$.name} API请求失败请检查网路重试`)
} else {
if (safeGet(data)) {
data = JSON.parse(data);
if(data.code===0 && data.data.result){
console.log(`【京东账号${$.index}${$.nickName || $.UserName})签到领现金】${data.data.result.inviteCode}`);
}
}
}
} catch (e) {
$.logErr(e, resp)
} finally {
resolve(data);
}
})
})
}
async function getShareCode() { async function getShareCode() {
console.log(`======账号${$.index}开始======`) console.log(`======账号${$.index}开始======`)
await getJDFruit()
await getJdPet()
await getPlantBean()
await getJdFactory() await getJdFactory()
await getJxFactory() await getJxFactory()
await getJxNc() await getJxNc()
await getJdPet()
await getPlantBean()
await getJDFruit()
await getJdZZ() await getJdZZ()
await getJoy() await getJoy()
await getSgmh() await getSgmh()
await getCFD() await getCFD()
await getJdCash()
console.log(`======账号${$.index}结束======\n`) console.log(`======账号${$.index}结束======\n`)
} }