()
| 617 | }) |
| 618 | } |
| 619 | function 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 | //喂食 |
| 650 | function feedPets(feedNum) { |
| 651 | return new Promise(resolve => { |
no test coverage detected