| 521 | |
| 522 | //领取狗粮API |
| 523 | function getFood(type) { |
| 524 | return new Promise(resolve => { |
| 525 | // const url = `${weAppUrl}/getFood?reqSource=weapp&taskType=${type}`; |
| 526 | const host = `draw.jdfcloud.com`; |
| 527 | const reqSource = 'weapp'; |
| 528 | let opt = { |
| 529 | // url: "//jdjoy.jd.com/common/pet/getPetTaskConfig?reqSource=h5", |
| 530 | url: `//draw.jdfcloud.com/common/pet/getFood?reqSource=weapp&taskType=${type}&reqSource=h5&invokeKey=Oex5GmEuqGep1WLC`, |
| 531 | method: "GET", |
| 532 | data: {}, |
| 533 | credentials: "include", |
| 534 | header: {"content-type": "application/json"} |
| 535 | } |
| 536 | const url = "https:"+ taroRequest(opt)['url'] |
| 537 | $.get(taskUrl(url, host, reqSource), (err, resp, data) => { |
| 538 | try { |
| 539 | if (err) { |
| 540 | console.log('\n京东宠汪汪: API查询请求失败 ‼️‼️') |
| 541 | } else { |
| 542 | data = JSON.parse(data); |
| 543 | } |
| 544 | } catch (e) { |
| 545 | $.logErr(e, resp); |
| 546 | } finally { |
| 547 | resolve(data); |
| 548 | } |
| 549 | }) |
| 550 | }) |
| 551 | } |
| 552 | //关注店铺api |
| 553 | function followShop(shopId) { |
| 554 | return new Promise(resolve => { |