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

Function getReward

jd_speed.js:585–616  ·  view source on GitHub ↗
(uuid)

Source from the content-addressed store, hash-verified

583 })
584}
585function getReward(uuid) {
586 return new Promise((resolve) => {
587 const body = { "source": "game", uuid};
588 const options = {
589 url: `${JD_API_HOST}?appid=memberTaskCenter&functionId=member_getReward&body=${escape(JSON.stringify(body))}&_t=${Date.now()}`,
590 headers: {
591 Referer: 'https://h5.m.jd.com/babelDiy/Zeus/6yCQo2eDJPbyPXrC3eMCtMWZ9ey/index.html',
592 Cookie: cookie,
593 "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.4.4;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1")
594 }
595 }
596 $.get(options, async (err, resp, data) => {
597 try {
598 if (err) {
599 console.log(`${$.name} API请求失败,请检查网路重试`)
600 console.log(`${JSON.stringify(err)}`)
601 } else {
602 if (safeGet(data)) {
603 data = JSON.parse(data);
604 if (data && data.success) {
605 $.getRewardBeans += data.data.beans;
606 }
607 }
608 }
609 } catch (e) {
610 $.logErr(e, resp)
611 } finally {
612 resolve()
613 }
614 })
615 })
616}
617function TotalBean() {
618 return new Promise(async resolve => {
619 const options = {

Callers 1

getMemBerListFunction · 0.70

Calls 6

safeGetFunction · 0.70
isNodeMethod · 0.45
getdataMethod · 0.45
getMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected