()
| 358 | } |
| 359 | |
| 360 | async getLoginCode() { |
| 361 | if (!process.env.wx_auth) throw new Error("未配置 wx_auth,无法通过 wx_server 获取 code"); |
| 362 | const { data } = await this.wechat.getCode(this.account); |
| 363 | const code = data?.code || data?.data?.code; |
| 364 | if (!code) throw new Error(`wx_server 未返回 code: ${JSON.stringify(data)}`); |
| 365 | return code; |
| 366 | } |
| 367 | |
| 368 | async login() { |
| 369 | const loginApis = [ |