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

Method request

wxapp/jingjianx_all.js:315–329  ·  view source on GitHub ↗
({ method = "GET", apiPath, shopId = "", token = "", params = {}, data = {}, bizCode = "" })

Source from the content-addressed store, hash-verified

313 }
314
315 async request({ method = "GET", apiPath, shopId = "", token = "", params = {}, data = {}, bizCode = "" }) {
316 const options = {
317 method,
318 url: `${this.app.apiBase}${apiPath}`,
319 headers: this.headers(shopId, token, bizCode ? { "JJ-BizCode": bizCode } : {}),
320 timeout: 20000,
321 validateStatus: () => true,
322 };
323 if (method === "GET") options.params = params;
324 else options.data = data;
325
326 const { data: result, status } = await axios.request(options);
327 if (status > 400) throw new Error(`HTTP ${status}: ${JSON.stringify(result)}`);
328 return result;
329 }
330}
331
332class ShopTask {

Callers 6

checkTokenMethod · 0.45
loginMethod · 0.45
getAssetsMethod · 0.45
getRewardMethod · 0.45
getProgressMethod · 0.45
signMethod · 0.45

Calls 1

headersMethod · 0.95

Tested by

no test coverage detected