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

Function request

wxapp/aima.js:102–119  ·  view source on GitHub ↗
(method, url, token, options = {})

Source from the content-addressed store, hash-verified

100}
101
102async function request(method, url, token, options = {}) {
103 const res = await axios({
104 method,
105 url,
106 headers: buildHeaders(token),
107 timeout: 15000,
108 validateStatus: () => true,
109 ...options,
110 });
111
112 const newToken = getResponseToken(res.headers);
113 if (newToken && options.account) {
114 options.onToken?.(newToken);
115 updateCachedToken(options.account, newToken);
116 }
117
118 return res;
119}
120
121async function getWxCode(account) {
122 const wxServerUrl = process.env.wx_server_url;

Callers 3

loginByCodeFunction · 0.70
validateTokenFunction · 0.70
signInFunction · 0.70

Calls 3

buildHeadersFunction · 0.85
getResponseTokenFunction · 0.85
updateCachedTokenFunction · 0.85

Tested by

no test coverage detected