MCPcopy Create free account
hub / github.com/Tron521/codex-console-temp / openGptOfficialLogin

Function openGptOfficialLogin

static/js/payment.js:1251–1273  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1249}
1250
1251async 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
1275async function fetchSelectedAccountInbox() {
1276 const accountId = Number(document.getElementById("account-select")?.value || 0);

Callers

nothing calls this directly

Calls 4

formatErrorMessageFunction · 0.85
warningMethod · 0.80
successMethod · 0.80
postMethod · 0.45

Tested by

no test coverage detected