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

Function followScan

jd_joy.js:423–456  ·  view source on GitHub ↗
(sku)

Source from the content-addressed store, hash-verified

421 })
422}
423function followScan(sku) {
424 return new Promise(resolve => {
425 // const url = `${JD_API_HOST}/scan`;
426 const host = `jdjoy.jd.com`;
427 const reqSource = 'h5';
428 const body = {
429 "taskType": "ScanDeskGood",
430 "reqSource": "h5",
431 sku
432 }
433 let opt = {
434 url: "//jdjoy.jd.com/common/pet/scan?reqSource=h5&invokeKey=Oex5GmEuqGep1WLC",
435 // url: "//draw.jdfcloud.com/common/pet/getPetTaskConfig?reqSource=h5",
436 method: "POST",
437 data: body,
438 credentials: "include",
439 header: {"content-type": "application/json"}
440 }
441 const url = "https:"+ taroRequest(opt)['url']
442 $.post(taskPostUrl(url, JSON.stringify(body), reqSource, host, 'application/json'), (err, resp, data) => {
443 try {
444 if (err) {
445 console.log('\n京东宠汪汪: API查询请求失败 ‼️‼️')
446 } else {
447 data = JSON.parse(data);
448 }
449 } catch (e) {
450 $.logErr(e, resp);
451 } finally {
452 resolve(data);
453 }
454 })
455 })
456}
457//小程序逛会场,浏览频道,关注商品API
458function scanMarket(type, body, cType = 'application/json') {
459 return new Promise(resolve => {

Callers 1

deskGoodsTaskFunction · 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