()
| 774 | } |
| 775 | //查询赛跑排行榜 |
| 776 | function getRankList() { |
| 777 | return new Promise(resolve => { |
| 778 | // const url = `${JD_API_HOST}/combat/getRankList`; |
| 779 | $.raceUsers = []; |
| 780 | let opt = { |
| 781 | url: "//jdjoy.jd.com/common/pet/combat/getRankList?reqSource=h5&invokeKey=Oex5GmEuqGep1WLC", |
| 782 | // url: "//draw.jdfcloud.com/common/pet/getPetTaskConfig?reqSource=h5", |
| 783 | method: "GET", |
| 784 | data: {}, |
| 785 | credentials: "include", |
| 786 | header: {"content-type": "application/json"} |
| 787 | } |
| 788 | const url = "https:"+ taroRequest(opt)['url'] |
| 789 | $.get(taskUrl(url, `jdjoy.jd.com`, 'h5'), (err, resp, data) => { |
| 790 | try { |
| 791 | if (err) { |
| 792 | console.log('\n京东宠汪汪: API查询请求失败 ‼️‼️') |
| 793 | } else { |
| 794 | // console.log('查询赛跑信息API',(data)) |
| 795 | data = JSON.parse(data); |
| 796 | if (data.success) { |
| 797 | $.raceUsers = data.datas; |
| 798 | } |
| 799 | } |
| 800 | } catch (e) { |
| 801 | $.logErr(e, resp); |
| 802 | } finally { |
| 803 | resolve(); |
| 804 | } |
| 805 | }) |
| 806 | }) |
| 807 | } |
| 808 | //参加赛跑API |
| 809 | function runMatch(teamLevel, timeout = 5000) { |
| 810 | if (teamLevel === 10 || teamLevel === 50) timeout = 60000; |
no test coverage detected