MCPcopy Create free account
hub / github.com/smallfawn/QLScriptPublic / request

Method request

wxapp/hezj.js:64–92  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

62
63 }
64 request(options) {
65 const path = options.path || new URL(options.url).pathname;
66 const timestamp = Date.now();
67 let baseHeaers = {
68 "host": "zj.haier.net",
69 "Content-Type": "application/json;charset=UTF-8",
70 "appId": HA_APP_ID,
71 "appKey": HA_APP_KEY,
72 "timestamp": timestamp,
73 "platForm": "sc-mp-wx-zjapp",
74 "ENV": "",
75 "accessToken": options.isHeaderDelToken ? "" : this.token,
76 "accountToken": options.isHeaderDelToken ? "" : this.token,
77 "ak": options.isHeaderDelToken ? "" : this.token,
78 "clientId": this.clientId,
79 "accept": "*/*",
80 "accept-language": "zh-CN,zh-Hans;q=0.9",
81 "user-agent": defaultUserAgent,
82 "referer": `https://servicewechat.com/${MINI_APP_ID}/${PAGE_VERSION}/page-frame.html`,
83 }
84 if (options.isSign256) {
85 baseHeaers.sign = sign256(path, options.data, timestamp);
86 }
87 options.headers = Object.assign(baseHeaers, options.headers || {});
88 delete options.path;
89 delete options.isSign256;
90 delete options.isHeaderDelToken;
91 return axios.request(options)
92 }
93
94 async run() {
95 await this.loginByWxCode();

Callers 5

jscode2sessionMethod · 0.95
queryUserInfoMethod · 0.95
pointInfoMethod · 0.95
signInMethod · 0.95
getNoticeFunction · 0.45

Calls 1

sign256Function · 0.85

Tested by

no test coverage detected