()
| 1249 | } |
| 1250 | |
| 1251 | async function openGptOfficialLogin() { |
| 1252 | const accountId = Number(document.getElementById("account-select")?.value || 0); |
| 1253 | if (!accountId) { |
| 1254 | toast.warning("请先选择账号"); |
| 1255 | return; |
| 1256 | } |
| 1257 | const loginUrl = "https://chatgpt.com/auth/login"; |
| 1258 | try { |
| 1259 | const data = await api.post("/payment/open-incognito", { |
| 1260 | url: loginUrl, |
| 1261 | account_id: accountId, |
| 1262 | }); |
| 1263 | if (data?.success) { |
| 1264 | toast.success("已打开 GPT 官方登录页(无痕)"); |
| 1265 | return; |
| 1266 | } |
| 1267 | window.open(loginUrl, "_blank", "noopener,noreferrer"); |
| 1268 | toast.warning(data?.message || "未找到可用浏览器,已在当前浏览器打开"); |
| 1269 | } catch (error) { |
| 1270 | window.open(loginUrl, "_blank", "noopener,noreferrer"); |
| 1271 | toast.warning(`打开无痕失败,已在当前浏览器打开: ${formatErrorMessage(error)}`); |
| 1272 | } |
| 1273 | } |
| 1274 | |
| 1275 | async function fetchSelectedAccountInbox() { |
| 1276 | const accountId = Number(document.getElementById("account-select")?.value || 0); |
nothing calls this directly
no test coverage detected