| 297 | } |
| 298 | |
| 299 | headers(shopId = "", token = "", extra = {}) { |
| 300 | const headers = { |
| 301 | "User-Agent": USER_AGENT, |
| 302 | "Referer": `https://servicewechat.com/${this.app.appid}/1/page-frame.html`, |
| 303 | "content-type": "application/json", |
| 304 | "JJ-CHAINID": this.app.chainId, |
| 305 | "BDSZH-SHOPID": shopId, |
| 306 | "JJ-SHOPID": shopId, |
| 307 | "JJ-MiniAppVersion": this.app.version, |
| 308 | "JJ-AppId": this.app.appid, |
| 309 | ...extra, |
| 310 | }; |
| 311 | if (token) headers.Authorization = `Bearer ${token}`; |
| 312 | return headers; |
| 313 | } |
| 314 | |
| 315 | async request({ method = "GET", apiPath, shopId = "", token = "", params = {}, data = {}, bizCode = "" }) { |
| 316 | const options = { |