()
| 202 | } |
| 203 | |
| 204 | async getLoginCode() { |
| 205 | if (!process.env.wx_auth) throw new Error("缺少 wx_auth,无法从 wx_server 获取 code"); |
| 206 | const { data } = await wechat.getCode(this.account); |
| 207 | const code = data && (data.code || (data.data && data.data.code)); |
| 208 | if (!code) throw new Error(`wx_server 未返回 code: ${JSON.stringify(data)}`); |
| 209 | return code; |
| 210 | } |
| 211 | |
| 212 | async getIdentityInfo() { |
| 213 | try { |