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

Method mapApi

wxapp/txdt.js:257–270  ·  view source on GitHub ↗
(apiPath, data)

Source from the content-addressed store, hash-verified

255 }
256
257 async mapApi(apiPath, data) {
258 const { status, data: body } = await request({
259 method: "POST",
260 url: `${MAP_BASE}${apiPath}`,
261 headers: {
262 "content-type": "application/json",
263 ...checkinHeader(this.loginInfo),
264 ...mapH5Sign(apiPath, this.loginInfo),
265 },
266 data,
267 });
268 if (status !== 200 || Number(body?.code) !== 0) throw new Error(`${apiPath} HTTP ${status}: ${short(body)}`);
269 return body.data || {};
270 }
271
272 async queryBalance(prefix = "现金余额") {
273 const data = await this.mapApi("/activity/v1/withdraw/home", {

Callers 4

queryBalanceMethod · 0.95
queryAssetsMethod · 0.95
queryCalendarMethod · 0.95
checkinMethod · 0.95

Calls 4

checkinHeaderFunction · 0.85
mapH5SignFunction · 0.85
requestFunction · 0.70
shortFunction · 0.70

Tested by

no test coverage detected