MCPcopy Index your code
hub / github.com/smallfawn/QLScriptPublic / request

Method request

wxapp/fsdlb.js:168–183  ·  view source on GitHub ↗
({ method = "GET", path: apiPath, data, params, auth = true })

Source from the content-addressed store, hash-verified

166 }
167
168 async request({ method = "GET", path: apiPath, data, params, auth = true }) {
169 const options = {
170 method,
171 url: `${API_BASE}${apiPath.startsWith("/") ? apiPath : `/${apiPath}`}`,
172 headers: this.getHeaders({}, auth),
173 timeout: 15000,
174 validateStatus: () => true,
175 };
176 if (params) options.params = params;
177 if (data !== undefined) options.data = data;
178
179 const { data: result, status } = await axios.request(options);
180 if (status !== 200) throw new Error(`HTTP ${status}: ${JSON.stringify(result)}`);
181 if (!isSuccess(result)) throw new Error(result?.msg || JSON.stringify(result));
182 return result.data;
183 }
184
185 async getLoginCode() {
186 const { data } = await wechat.getCode(this.openid);

Callers 5

loginByWxCodeMethod · 0.95
checkTokenMethod · 0.95
signInMethod · 0.95
infoMethod · 0.95
getNoticeFunction · 0.45

Calls 2

getHeadersMethod · 0.95
isSuccessFunction · 0.70

Tested by

no test coverage detected