(type, body, cType = 'application/json')
| 456 | } |
| 457 | //小程序逛会场,浏览频道,关注商品API |
| 458 | function 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逛会场 |
| 491 | function appScanMarket(type, body) { |
| 492 | return new Promise(resolve => { |
no test coverage detected