MCPcopy Create free account
hub / github.com/Toulu-debug/enen / api

Method api

jd_miniTask.ts:23–38  ·  view source on GitHub ↗
(fn: string, body: object)

Source from the content-addressed store, hash-verified

21 }
22
23 async api(fn: string, body: object): Promise<any> {
24 let ts: number = Date.now()
25 let h5st: string = this.h5stTool.genH5st('hot_channel', body, 'android', '8.21.260', fn, ts)
26 return await this.post(`https://api.m.jd.com/${fn}`,
27 `loginType=2&client=android&clientVersion=8.21.260&functionId=${fn}&t=${ts}&body=${encodeURIComponent(JSON.stringify(body))}&appid=hot_channel&d_name=&h5st=${h5st}&_ste=2`,
28 {
29 'Host': 'api.m.jd.com',
30 'User-Agent': this.user.UserAgent,
31 'Cookie': this.user.cookie,
32 'X-Referer-Package': 'wx91d27dbf599dff74',
33 'wqreferer': 'http://wq.jd.com/wxapp/pages/yixiaoshida/index/index',
34 'X-Rp-Client': 'mini_2.0.0',
35 'X-Referer-Page': '/pages/yixiaoshida/index/index',
36 'referer': 'https://servicewechat.com/wx91d27dbf599dff74/728/page-frame.html'
37 })
38 }
39
40 async main(user: User) {
41 try {

Callers 1

mainMethod · 0.95

Calls 1

postMethod · 0.45

Tested by

no test coverage detected