| 144 | } |
| 145 | |
| 146 | getHeaders(extra = {}, auth = true) { |
| 147 | const headers = { |
| 148 | componentSend: "1", |
| 149 | "HH-FROM": MERCHANT_APP_NAME, |
| 150 | "HH-APP": MINI_APP_ID, |
| 151 | "HH-VERSION": TEMPLATE_VERSION, |
| 152 | "X-VERSION": X_VERSION, |
| 153 | "Content-Type": "application/json", |
| 154 | appPublishType: APP_PUBLISH_TYPE, |
| 155 | "HH-CI": CLIENT_ID, |
| 156 | "MARKETING-PLAN-NO": "", |
| 157 | "USER-ENTRANCE-CHANNEL": "", |
| 158 | "USER-ENTRANCE-CHANNEL-KEY": "", |
| 159 | "ONE-ID": this.userInfo.oneId || "", |
| 160 | groupPosId: "", |
| 161 | "User-Agent": USER_AGENT, |
| 162 | ...extra, |
| 163 | }; |
| 164 | if (auth && this.token) headers.Authorization = `bearer ${this.token}`; |
| 165 | return headers; |
| 166 | } |
| 167 | |
| 168 | async request({ method = "GET", path: apiPath, data, params, auth = true }) { |
| 169 | const options = { |