(openid)
| 289 | } |
| 290 | |
| 291 | async getCode(openid) { |
| 292 | if (!WX_AUTH) throw new Error("未配置 wx_auth,无法通过 wx_server 获取 code"); |
| 293 | const { data } = await this.wx.getCode(openid); |
| 294 | const code = data?.code || data?.data?.code; |
| 295 | if (!code) throw new Error(`wx_server 未返回 code: ${JSON.stringify(data)}`); |
| 296 | return code; |
| 297 | } |
| 298 | |
| 299 | headers(shopId = "", token = "", extra = {}) { |
| 300 | const headers = { |