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

Function getFood

jd_joy.js:523–551  ·  view source on GitHub ↗
(type)

Source from the content-addressed store, hash-verified

521
522//领取狗粮API
523function 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
553function followShop(shopId) {
554 return new Promise(resolve => {

Callers 1

petTaskFunction · 0.85

Calls 5

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

Tested by

no test coverage detected