| 120 | } |
| 121 | |
| 122 | headers(withToken = true) { |
| 123 | const headers = { |
| 124 | "User-Agent": USER_AGENT, |
| 125 | "Referer": `https://servicewechat.com/${MINI_APP_ID}/5/page-frame.html`, |
| 126 | "Accept": "application/json, text/plain, */*", |
| 127 | "appId": MINI_APP_ID, |
| 128 | "version": VERSION, |
| 129 | "envVersion": "release", |
| 130 | }; |
| 131 | if (withToken && this.accessToken) headers.Authorization = `bearer${this.accessToken}`; |
| 132 | return headers; |
| 133 | } |
| 134 | |
| 135 | async request({ method = "GET", apiPath, data = {}, params = {}, needToken = true }) { |
| 136 | const options = { |