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

Function getMemBerGetTask

jd_speed.js:553–584  ·  view source on GitHub ↗
(sourceId)

Source from the content-addressed store, hash-verified

551}
552//领取虫洞任务API
553function getMemBerGetTask(sourceId) {
554 return new Promise((resolve) => {
555 const body = { "source": "game", sourceId};
556 const options = {
557 url: `${JD_API_HOST}?appid=memberTaskCenter&functionId=member_getTask&body=${escape(JSON.stringify(body))}&_t=${Date.now()}`,
558 headers: {
559 Referer: 'https://h5.m.jd.com/babelDiy/Zeus/6yCQo2eDJPbyPXrC3eMCtMWZ9ey/index.html',
560 Cookie: cookie,
561 "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")
562 }
563 }
564 $.get(options, async (err, resp, data) => {
565 try {
566 if (err) {
567 console.log(`${$.name} API请求失败,请检查网路重试`)
568 console.log(`${JSON.stringify(err)}`)
569 } else {
570 if (safeGet(data)) {
571 data = JSON.parse(data);
572 if (data && data.success) {
573 // $.getRewardBeans += data.data.beans;
574 }
575 }
576 }
577 } catch (e) {
578 $.logErr(e, resp)
579 } finally {
580 resolve()
581 }
582 })
583 })
584}
585function getReward(uuid) {
586 return new Promise((resolve) => {
587 const body = { "source": "game", uuid};

Callers 1

getMemBerListFunction · 0.85

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