(apiPath, data)
| 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", { |
no test coverage detected