()
| 1273 | } |
| 1274 | |
| 1275 | async function fetchSelectedAccountInbox() { |
| 1276 | const accountId = Number(document.getElementById("account-select")?.value || 0); |
| 1277 | const email = getSelectedAccountEmail(); |
| 1278 | if (!accountId || !email) { |
| 1279 | toast.warning("请先选择账号"); |
| 1280 | return; |
| 1281 | } |
| 1282 | toast.info(`正在查询 ${email} 收件箱...`); |
| 1283 | try { |
| 1284 | const result = await api.post(`/accounts/${accountId}/inbox-code`, {}); |
| 1285 | if (result?.success && result?.code) { |
| 1286 | const code = String(result.code).trim(); |
| 1287 | copyToClipboard(code); |
| 1288 | toast.success(`${email} 最新验证码: ${code}(已复制)`, 8000); |
| 1289 | return; |
| 1290 | } |
| 1291 | toast.error(`查询失败: ${result?.error || "未收到验证码"}`); |
| 1292 | } catch (error) { |
| 1293 | toast.error(`查询失败: ${formatErrorMessage(error)}`); |
| 1294 | } |
| 1295 | } |
| 1296 | |
| 1297 | function stopVendorProgressPolling() { |
| 1298 | if (!vendorProgressState.timer) return; |
nothing calls this directly
no test coverage detected