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

Function enterRoom

jd_joy.js:583–618  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

581 })
582}
583function enterRoom() {
584 return new Promise(resolve => {
585 // const url = `${weAppUrl}/enterRoom/h5?reqSource=weapp&invitePin=&openId=`;
586 const host = `draw.jdfcloud.com`;
587 const reqSource = 'weapp';
588 let opt = {
589 // url: "//jdjoy.jd.com/common/pet/getPetTaskConfig?reqSource=h5",
590 url: `//draw.jdfcloud.com/common/pet/enterRoom/h5?reqSource=h5&invitePin=&openId=&invokeKey=Oex5GmEuqGep1WLC`,
591 method: "GET",
592 data: {},
593 credentials: "include",
594 header: {"content-type": "application/json"}
595 }
596 const url = "https:"+ taroRequest(opt)['url']
597 $.post({...taskUrl(url, host, reqSource),body:'{}'}, (err, resp, data) => {
598 try {
599 if (err) {
600 console.log('\n京东宠汪汪: API查询请求失败 ‼️‼️')
601 } else {
602 // console.log('JSON.parse(data)', JSON.parse(data))
603
604 $.roomData = JSON.parse(data);
605
606 console.log(`现有狗粮: ${$.roomData.data.petFood}\n`)
607
608 subTitle = `【用户名】${$.roomData.data.pin}`
609 message = `现有积分: ${$.roomData.data.petCoin}\n现有狗粮: ${$.roomData.data.petFood}\n喂养次数: ${$.roomData.data.feedCount}\n宠物等级: ${$.roomData.data.petLevel}\n`
610 }
611 } catch (e) {
612 $.logErr(e, resp);
613 } finally {
614 resolve();
615 }
616 })
617 })
618}
619function appGetPetTaskConfig() {
620 return new Promise(resolve => {
621 // const url = `${JD_API_HOST}/getPetTaskConfig?reqSource=h5`;

Callers 1

jdJoyFunction · 0.70

Calls 5

taroRequestFunction · 0.70
taskUrlFunction · 0.70
postMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected