mirror of
https://github.com/6dylan6/jdpro.git
synced 2026-05-04 03:43:04 +08:00
1
This commit is contained in:
+23
-9
@@ -1055,22 +1055,36 @@ async function Monthbean() {
|
|||||||
async function jdCash() {
|
async function jdCash() {
|
||||||
if (!EnableCash)
|
if (!EnableCash)
|
||||||
return;
|
return;
|
||||||
let functionId = "cash_homePage";
|
let opt = {
|
||||||
let sign = await getSignfromNolan(functionId, {});
|
url: `https://api.m.jd.com`,
|
||||||
|
body: `functionId=cash_exchange_center&body={"version":"1","channel":"app"}&appid=signed_wh5&client=android&clientVersion=11.8.0&t=${Date.now()}`,
|
||||||
|
headers: {
|
||||||
|
'Host': 'api.m.jd.com',
|
||||||
|
'Origin': 'https://h5.m.jd.com',
|
||||||
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
|
'User-Agent': $.UA,
|
||||||
|
'Cookie': cookie
|
||||||
|
}
|
||||||
|
}
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
$.post(apptaskUrl(functionId, sign), async (err, resp, data) => {
|
$.post(opt, async (err, resp, data) => {
|
||||||
try {
|
try {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log(`${JSON.stringify(err)}`)
|
console.log(`${JSON.stringify(err)}`)
|
||||||
console.log(`jdCash API请求失败,请检查网路重试`)
|
console.log(`jdCash API请求失败,请检查网路重试`)
|
||||||
} else {
|
} else {
|
||||||
if (safeGet(data)) {
|
if (safeGet(data)) {
|
||||||
data = JSON.parse(data);
|
data = JSON.parse(data)
|
||||||
if (data.code === 0 && data.data.result) {
|
if (data.code == 0) {
|
||||||
$.jdCash = data.data.result.totalMoney || 0;
|
if (data.data.bizCode == 0) {
|
||||||
return
|
$.jdCash = data.data.result.userMoney;
|
||||||
}
|
} else {
|
||||||
}
|
//console.log(data.data.bizMsg);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log(data.msg)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
$.logErr(e, resp)
|
$.logErr(e, resp)
|
||||||
|
|||||||
Reference in New Issue
Block a user