From 2be0b71018ed1b5f9c6dd5103c49f5be8d6ca6a6 Mon Sep 17 00:00:00 2001 From: "2569718930@qq.com" <2569718930@qq.com> Date: Sun, 24 May 2026 18:12:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20Telegram=20=E7=BB=91?= =?UTF-8?q?=E5=AE=9A=E6=8C=89=E9=92=AE=E8=A2=AB=E6=B5=8F=E8=A7=88=E5=99=A8?= =?UTF-8?q?=20popup=20=E6=8B=A6=E6=88=AA=EF=BC=9A=E5=85=88=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E6=89=93=E5=BC=80=E7=AA=97=E5=8F=A3=E5=86=8D=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/components/account/AccountCenter.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/components/account/AccountCenter.tsx b/frontend/components/account/AccountCenter.tsx index c7573db8..c8f5c0c5 100644 --- a/frontend/components/account/AccountCenter.tsx +++ b/frontend/components/account/AccountCenter.tsx @@ -1148,6 +1148,7 @@ export function AccountCenter() { const openTelegramBotBindLink = async () => { setTelegramBindOpening(true); setPaymentError(""); + const popup = window.open("about:blank", "_blank", "noopener,noreferrer"); try { const authHeaders = await buildAuthedHeaders(true, false); const res = await fetch("/api/auth/telegram/bot-bind-link", { @@ -1161,11 +1162,16 @@ export function AccountCenter() { const data = (await res.json()) as { bot_url?: string }; const botUrl = String(data.bot_url || "").trim(); if (!botUrl) throw new Error("telegram bind link missing"); - window.open(botUrl, "_blank", "noopener,noreferrer"); + if (popup && !popup.closed) { + popup.location.href = botUrl; + } else { + window.open(botUrl, "_blank", "noopener,noreferrer"); + } setPaymentInfo( "已打开 Telegram Bot,请在 Bot 内点击 Start 并确认绑定;完成后刷新本页再申请入群。", ); } catch (error) { + if (popup && !popup.closed) popup.close(); setPaymentError(normalizePaymentError(error).message); } finally { setTelegramBindOpening(false);