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

Function appGetPetTaskConfig

jd_joy.js:619–648  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

617 })
618}
619function appGetPetTaskConfig() {
620 return new Promise(resolve => {
621 // const url = `${JD_API_HOST}/getPetTaskConfig?reqSource=h5`;
622 const host = `jdjoy.jd.com`;
623 const reqSource = 'h5';
624 let opt = {
625 url: "//jdjoy.jd.com/common/pet/getPetTaskConfig?reqSource=h5&invokeKey=Oex5GmEuqGep1WLC",
626 // url: `//draw.jdfcloud.com/common/pet/feed?feedCount=${feedNum}&reqSource=h5`,
627 method: "GET",
628 data: {},
629 credentials: "include",
630 header: {"content-type": "application/json"}
631 }
632 const url = "https:"+ taroRequest(opt)['url']
633 $.get(taskUrl(url, host, reqSource), (err, resp, data) => {
634 try {
635 if (err) {
636 console.log('\n京东宠汪汪: API查询请求失败 ‼️‼️')
637 } else {
638 // console.log('----', JSON.parse(data))
639 $.appGetPetTaskConfigRes = JSON.parse(data);
640 }
641 } catch (e) {
642 $.logErr(e, resp);
643 } finally {
644 resolve();
645 }
646 })
647 })
648}
649//喂食
650function feedPets(feedNum) {
651 return new Promise(resolve => {

Callers 1

appPetTaskFunction · 0.85

Calls 5

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

Tested by

no test coverage detected