MCPcopy Create free account
hub / github.com/NobyDa/Script / TotalSteel

Function TotalSteel

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

Source from the content-addressed store, hash-verified

1424}
1425
1426function TotalSteel() {
1427 merge.TotalSteel = {};
1428 return new Promise(resolve => {
1429 if (disable("TSteel")) return resolve()
1430 $nobyda.get({
1431 url: 'https://coin.jd.com/m/gb/getBaseInfo.html',
1432 headers: {
1433 Cookie: KEY
1434 }
1435 }, (error, response, data) => {
1436 try {
1437 if (error) throw new Error(error);
1438 const Details = LogDetails ? "response:\n" + data : '';
1439 if (data.match(/(\"gbBalance\":\d+)/)) {
1440 console.log("\n" + "京东-总钢镚查询成功 " + Details)
1441 const cc = JSON.parse(data)
1442 merge.TotalSteel.TSteel = cc.gbBalance
1443 } else {
1444 console.log("\n" + "京东-总钢镚查询失败 " + Details)
1445 }
1446 } catch (eor) {
1447 $nobyda.AnError("账户钢镚-查询", "TotalSteel", eor, response, data)
1448 } finally {
1449 resolve()
1450 }
1451 })
1452 if (out) setTimeout(resolve, out)
1453 });
1454}
1455
1456function TotalBean() {
1457 merge.TotalBean = {};

Callers 1

allFunction · 0.85

Calls 3

disableFunction · 0.85
getMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected