(pathname, data = {}, { addHead = true } = {})
| 357 | } |
| 358 | |
| 359 | async ctripRequest(pathname, data = {}, { addHead = true } = {}) { |
| 360 | const body = { ...(data || {}) }; |
| 361 | if (addHead) body.head = this.dataHead(body.head || {}); |
| 362 | const raw = JSON.stringify(body); |
| 363 | const res = await axios.post(`${API_BASE}${pathname}?_fxpcqlniredt=${CLIENT_ID}`, raw, { |
| 364 | timeout: 30000, |
| 365 | validateStatus: () => true, |
| 366 | headers: this.headers(raw), |
| 367 | }); |
| 368 | return { |
| 369 | status: res.status, |
| 370 | data: res.data, |
| 371 | text: typeof res.data === "string" ? res.data : JSON.stringify(res.data), |
| 372 | }; |
| 373 | } |
| 374 | |
| 375 | async querySignStatus() { |
| 376 | const res = await this.ctripRequest("/restapi/soa2/13012/getSignTodayInfoProxy", {}); |
no test coverage detected