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

Function request

wxapp/vipshop.js:123–136  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

121}
122
123async function request(options) {
124 const res = await axios.request({
125 timeout: 30000,
126 validateStatus: () => true,
127 ...options,
128 headers: {
129 Accept: "application/json, text/plain, */*",
130 "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 MicroMessenger MiniProgramEnv/Windows",
131 Referer: `https://servicewechat.com/${MINI_APP_ID}/${PACKAGE_VERSION}/page-frame.html`,
132 ...(options.headers || {}),
133 },
134 });
135 return { status: res.status, data: res.data, headers: res.headers || {} };
136}
137
138async function getWxCode(openid) {
139 if (!WX_AUTH) throw new Error("未配置 wx_auth,无法从 wx_server 获取 code");

Callers 5

getWxCodeFunction · 0.70
getVipWechatInfoMethod · 0.70
autoLoginMethod · 0.70
signInfoMethod · 0.70
signMethod · 0.70

Calls 1

requestMethod · 0.45

Tested by

no test coverage detected