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

Function doXdzTask

jd_star_shop.js:365–394  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

363}
364
365async function doXdzTask(){
366 const url = `https://api.m.jd.com/?body=%7B%22shopId%22:%22${$.shopId}%22,%22itemToken%22:%22${$.subItemInfo.itemToken}%22,%22token%22:%22${$.tokenId}%22%7D&appid=xdz&functionId=mcxhd_starmall_doTask&t=${Date.now()}&loginWQBiz=`;
367 const method = `GET`;
368 const headers = {
369 'Origin': `https://h5.m.jd.com`,
370 'Cookie': $.cookie,
371 'Accept-Encoding': `gzip, deflate, br`,
372 'Accept-Language': `zh-cn`,
373 '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"),
374 'Referer': `https://h5.m.jd.com/babelDiy/Zeus/3Vuj8Uw26NEDNRjaT2uspf2pphK/index.html`,
375 'Content-Type':`application/x-www-form-urlencoded;charset=UTF-8`,
376 'Accept': `application/json, text/plain, */*`,
377 'Host': `api.m.jd.com`,
378 };
379 const myRequest = {url: url, method: method, headers: headers,};
380 return new Promise(async resolve => {
381 $.get(myRequest, (err, resp, data) => {
382 try {
383 data = JSON.parse(data);
384 if (data.retCode === '200') {
385 console.log(`任务完成,获得星力值:${data.result.score}`);
386 }
387 } catch (e) {
388 $.logErr(e, resp)
389 } finally {
390 resolve();
391 }
392 })
393 })
394}
395
396async function getXdzUseInfo(){
397 const url = `https://api.m.jd.com/?body=%7B%22shopId%22:%22${$.shopId}%22,%22token%22:%22${$.tokenId }%22%7D&appid=xdz&functionId=mcxhd_starmall_taskList&t=${Date.now()}&loginWQBiz=`;

Callers

nothing calls this directly

Calls 5

isNodeMethod · 0.45
getdataMethod · 0.45
getMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected