(pathname, data, dxToken = "")
| 413 | } |
| 414 | |
| 415 | async taskPost(pathname, data, dxToken = "") { |
| 416 | const { data: result, status } = await axios.post(`${TASK_HOST}${pathname}`, data, { |
| 417 | headers: this.taskHeaders(dxToken), |
| 418 | timeout: 20000, |
| 419 | validateStatus: () => true, |
| 420 | }); |
| 421 | if (status !== 200) throw new Error(`HTTP ${status}: ${JSON.stringify(result)}`); |
| 422 | return result; |
| 423 | } |
| 424 | |
| 425 | async getLoginCode() { |
| 426 | if (!process.env.wx_auth) throw new Error("缺少 wx_auth,无法从 wx_server 获取 code"); |
no test coverage detected