MCPcopy Create free account
hub / github.com/Semporia/Scripts / TotalBean

Function TotalBean

JD_DailyBonus.js:1448–1480  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1446}
1447
1448function TotalBean() {
1449 merge.TotalBean = {};
1450 return new Promise(resolve => {
1451 if (disable("Qbear")) return resolve()
1452 $nobyda.get({
1453 url: 'https://me-api.jd.com/user_new/info/GetJDUserInfoUnion',
1454 headers: {
1455 Cookie: KEY
1456 }
1457 }, (error, response, data) => {
1458 try {
1459 if (error) throw new Error(error);
1460 const Details = LogDetails ? "response:\n" + data : '';
1461 const cc = JSON.parse(data)
1462 if (cc.msg == 'success' && cc.retcode == 0) {
1463 merge.TotalBean.nickname = cc.data.userInfo.baseInfo.nickname || ""
1464 merge.TotalBean.Qbear = cc.data.assetInfo.beanNum || 0
1465 $nobyda.headUrl = cc.data.userInfo.baseInfo.headImageUrl || ""
1466 console.log(`\n京东-总京豆查询成功 ${Details}`)
1467 } else {
1468 const name = decodeURIComponent(KEY.split(/pt_pin=(.+?);/)[1] || '');
1469 merge.TotalBean.nickname = cc.retcode == 1001 ? `${name} (CK失效‼️)` : "";
1470 console.log(`\n京东-总京豆查询失败 ${Details}`)
1471 }
1472 } catch (eor) {
1473 $nobyda.AnError("账户京豆-查询", "TotalBean", eor, response, data)
1474 } finally {
1475 resolve()
1476 }
1477 })
1478 if (out) setTimeout(resolve, out)
1479 });
1480}
1481
1482function TotalCash() {
1483 merge.TotalCash = {};

Callers 1

allFunction · 0.70

Calls 3

disableFunction · 0.85
getMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected