| 148 | } |
| 149 | |
| 150 | headers(extra = {}) { |
| 151 | const headers = { |
| 152 | "User-Agent": USER_AGENT, |
| 153 | "Referer": `https://servicewechat.com/${MINI_APP_ID}/${PAGE_VERSION}/page-frame.html`, |
| 154 | "Accept": "application/json, text/plain, */*", |
| 155 | appId: MINI_APP_ID, |
| 156 | version: APP_VERSION, |
| 157 | envVersion: ENV_VERSION, |
| 158 | "xy-extra-data": `appid=${MINI_APP_ID};version=${APP_VERSION};envVersion=${ENV_VERSION};`, |
| 159 | ...extra, |
| 160 | }; |
| 161 | if (this.authorization) headers.Authorization = this.authorization; |
| 162 | return headers; |
| 163 | } |
| 164 | |
| 165 | async request({ method = "POST", apiPath, params = {}, data = {}, skipToken = false }) { |
| 166 | const upperMethod = method.toUpperCase(); |