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

Function scanMarket

jd_joy.js:458–489  ·  view source on GitHub ↗
(type, body, cType = 'application/json')

Source from the content-addressed store, hash-verified

456}
457//小程序逛会场,浏览频道,关注商品API
458function scanMarket(type, body, cType = 'application/json') {
459 return new Promise(resolve => {
460 // const url = `${weAppUrl}/${type}`;
461 const host = `draw.jdfcloud.com`;
462 const reqSource = 'weapp';
463 let opt = {
464 // url: "//jdjoy.jd.com/common/pet/getPetTaskConfig?reqSource=h5",
465 url: `//draw.jdfcloud.com/common/pet/${type}?reqSource=weapp&invokeKey=Oex5GmEuqGep1WLC`,
466 method: "POST",
467 data: body,
468 credentials: "include",
469 header: {"content-type": cType}
470 }
471 const url = "https:"+ taroRequest(opt)['url']
472 if (cType === 'application/json') {
473 body = JSON.stringify(body)
474 }
475 $.post(taskPostUrl(url, body, reqSource, host, cType), (err, resp, data) => {
476 try {
477 if (err) {
478 console.log('\n京东宠汪汪: API查询请求失败 ‼️‼️')
479 } else {
480 data = JSON.parse(data);
481 }
482 } catch (e) {
483 $.logErr(e, resp);
484 } finally {
485 resolve(data);
486 }
487 })
488 })
489}
490//app逛会场
491function appScanMarket(type, body) {
492 return new Promise(resolve => {

Callers 2

petTaskFunction · 0.85
energySupplyStationFunction · 0.85

Calls 5

taroRequestFunction · 0.70
taskPostUrlFunction · 0.70
postMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected