(token = this.session.token)
| 120 | } |
| 121 | |
| 122 | getHeaders(token = this.session.token) { |
| 123 | const headers = { |
| 124 | "Content-Type": "application/json", |
| 125 | "User-Agent": USER_AGENT, |
| 126 | "Referer": `https://servicewechat.com/${MINI_APP_ID}/${PAGE_VERSION}/page-frame.html`, |
| 127 | }; |
| 128 | if (token) headers.Authorization = `Bearer ${token}`; |
| 129 | return headers; |
| 130 | } |
| 131 | |
| 132 | async request(apiPath, data = {}, token = this.session.token) { |
| 133 | const res = await axios.post(`${API_BASE}${apiPath}`, data || {}, { |