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

Function combatDetail

jd_joy_run.js:493–525  ·  view source on GitHub ↗
(invitePin)

Source from the content-addressed store, hash-verified

491 })
492}
493function combatDetail(invitePin) {
494 return new Promise(resolve => {
495 headers.Cookie = cookie;
496 headers.LKYLToken = $.LKYLToken;
497 let opt = {
498 // url: "//jdjoy.jd.com/common/pet/getPetTaskConfig?reqSource=h5",
499 url: `//draw.jdfcloud.com/common/pet/combat/detail/v2?help=true&inviterPin=${encodeURI(invitePin)}&reqSource=h5&invokeKey=qRKHmL4sna8ZOP9F`,
500 method: "GET",
501 data: {},
502 credentials: "include",
503 header: {"content-type": "application/json"}
504 }
505 const url = "https:"+ taroRequest(opt)['url'] + $.validate;
506 const options = {
507 url,
508 headers
509 }
510 $.get(options, (err, resp, data) => {
511 try {
512 if (err) {
513 $.log('API请求失败')
514 $.logErr(JSON.stringify(err));
515 } else {
516 data = JSON.parse(data);
517 }
518 } catch (e) {
519 $.logErr(e, resp)
520 } finally {
521 resolve(data);
522 }
523 });
524 })
525}
526function isURL(domain, reg) {
527 // const name = reg;
528 return reg.test(domain);

Callers 1

runFunction · 0.85

Calls 4

taroRequestFunction · 0.70
getMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected