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

Function request

wxapp/skyworth.js:100–114  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

98}
99
100async function request(options) {
101 const res = await axios.request({
102 timeout: 25000,
103 validateStatus: () => true,
104 ...options,
105 headers: {
106 "User-Agent": "Mozilla/5.0 MicroMessenger MiniProgramEnv/Windows",
107 Accept: "application/json, text/plain, */*",
108 "content-type": "application/json",
109 Referer: `https://servicewechat.com/${MINI_APP_ID}/${PACKAGE_VERSION}/page-frame.html`,
110 ...(options.headers || {}),
111 },
112 });
113 return { status: res.status, data: res.data, headers: res.headers || {} };
114}
115
116async function getWxCode(openid) {
117 if (!WX_AUTH) throw new Error("未配置 wx_auth,无法从 wx_server 获取 code");

Callers 2

getWxCodeFunction · 0.70
apiMethod · 0.70

Calls 1

requestMethod · 0.45

Tested by

no test coverage detected