(account)
| 106 | } |
| 107 | |
| 108 | async function getAuthCode(account) { |
| 109 | if (process.env.qqpcmgr_authCode) return process.env.qqpcmgr_authCode; |
| 110 | if (!WX_AUTH) throw new Error("未配置 wx_auth,无法通过 wx_server 授权二维码"); |
| 111 | if (!account) throw new Error("未配置 qqpcmgr openid,无法调用 /wx/qrcodeauth"); |
| 112 | const uuid = await getQrUuid(); |
| 113 | $.log(`获取 QRConnect UUID 成功: ${uuid}`); |
| 114 | const code = await qrcodeAuth(account, uuid); |
| 115 | return code; |
| 116 | } |
| 117 | |
| 118 | async function getQrUuid() { |
| 119 | const { data, status } = await axios.request({ |
no test coverage detected