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

Function runMatch

jd_joy.js:809–842  ·  view source on GitHub ↗
(teamLevel, timeout = 5000)

Source from the content-addressed store, hash-verified

807}
808//参加赛跑API
809function runMatch(teamLevel, timeout = 5000) {
810 if (teamLevel === 10 || teamLevel === 50) timeout = 60000;
811 console.log(`正在参赛中,请稍等${timeout / 1000}秒,以防多个账号匹配到统一赛场\n`)
812 return new Promise(async resolve => {
813 await $.wait(timeout);
814 // const url = `${JD_API_HOST}/combat/match?teamLevel=${teamLevel}`;
815 const host = `jdjoy.jd.com`;
816 const reqSource = 'h5';
817 let opt = {
818 url: `//jdjoy.jd.com/common/pet/combat/match?teamLevel=${teamLevel}&reqSource=h5&invokeKey=Oex5GmEuqGep1WLC`,
819 // url: `//draw.jdfcloud.com/common/pet/combat/match?teamLevel=${teamLevel}&reqSource=h5`,
820 method: "GET",
821 data: {},
822 credentials: "include",
823 header: {"content-type": "application/json"}
824 }
825 const url = "https:"+ taroRequest(opt)['url']
826 $.get(taskUrl(url, host, reqSource), (err, resp, data) => {
827 try {
828 if (err) {
829 console.log('\n京东宠汪汪: API查询请求失败 ‼️‼️')
830 } else {
831 // console.log('参加赛跑API', JSON.parse(data))
832 // $.appGetPetTaskConfigRes = JSON.parse(data);
833 $.runMatchResult = JSON.parse(data);
834 }
835 } catch (e) {
836 $.logErr(e, resp);
837 } finally {
838 resolve();
839 }
840 })
841 })
842}
843//查询应援团信息API
844function getBackupInfo() {
845 return new Promise(resolve => {

Callers 1

joinTwoPeopleRunFunction · 0.85

Calls 6

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

Tested by

no test coverage detected