MCPcopy Index your code
hub / github.com/NobyDa/Script / TotalSubsidy

Function TotalSubsidy

JD-DailyBonus/JD_DailyBonus.js:1521–1550  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1519}
1520
1521function TotalSubsidy() {
1522 merge.TotalSubsidy = {};
1523 return new Promise(resolve => {
1524 if (disable("TotalSubsidy")) return resolve()
1525 $nobyda.get({
1526 url: 'https://ms.jr.jd.com/gw/generic/uc/h5/m/mySubsidyBalance',
1527 headers: {
1528 Cookie: KEY,
1529 Referer: 'https://active.jd.com/forever/cashback/index?channellv=wojingqb'
1530 }
1531 }, (error, response, data) => {
1532 try {
1533 if (error) throw new Error(error);
1534 const cc = JSON.parse(data)
1535 const Details = LogDetails ? "response:\n" + data : '';
1536 if (cc.resultCode == 0 && cc.resultData && cc.resultData.data) {
1537 console.log("\n京东-总金贴查询成功 " + Details)
1538 merge.TotalSubsidy.TSubsidy = cc.resultData.data.balance || 0
1539 } else {
1540 console.log("\n京东-总金贴查询失败 " + Details)
1541 }
1542 } catch (eor) {
1543 $nobyda.AnError("账户金贴-查询", "TotalSubsidy", eor, response, data)
1544 } finally {
1545 resolve()
1546 }
1547 })
1548 if (out) setTimeout(resolve, out)
1549 });
1550}
1551
1552function TotalMoney() {
1553 merge.TotalMoney = {};

Callers 1

allFunction · 0.85

Calls 3

disableFunction · 0.85
getMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected