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

Method api

jd_windControl.ts:23–49  ·  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) {
24 let h5st: string = await this.h5stTool.__genH5st({
25 appid: 'plus_business',
26 body: JSON.stringify(body),
27 functionId: fn,
28 })
29 return await this.post(
30 `https://api.m.jd.com/api?functionId=${fn}`,
31 new URLSearchParams({
32 appid: 'plus_business',
33 loginType: '2',
34 loginWQBiz: '',
35 functionId: fn,
36 body: '{}',
37 h5st: h5st,
38 }),
39 {
40 'Host': 'api.m.jd.com',
41 'x-rp-client': 'h5_1.0.0',
42 'Origin': 'https://plus.m.jd.com',
43 'User-Agent': this.user.UserAgent,
44 'Referer': 'https://plus.m.jd.com/rights/windControl',
45 'x-referer-page': 'https://plus.m.jd.com/rights/windControl',
46 'Cookie': this.user.cookie,
47 }
48 )
49 }
50
51 async main(user: User) {
52 try {

Callers 1

mainMethod · 0.95

Calls 2

__genH5stMethod · 0.80
postMethod · 0.45

Tested by

no test coverage detected