From 4832678d72a2c3a49e11c14084297423d542a976 Mon Sep 17 00:00:00 2001 From: "2569718930@qq.com" <2569718930@qq.com> Date: Sun, 24 May 2026 18:55:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20Telegram=20=E7=BB=91?= =?UTF-8?q?=E5=AE=9A=E5=BC=B9=E7=AA=97=E6=8B=A6=E6=88=AA=EF=BC=9A=E6=8B=A6?= =?UTF-8?q?=E6=88=AA=E6=97=B6=E5=B1=95=E7=A4=BA=E5=8F=AF=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E9=93=BE=E6=8E=A5=E4=BE=9B=E6=89=8B=E5=8A=A8=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 | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/frontend/components/account/AccountCenter.tsx b/frontend/components/account/AccountCenter.tsx index e0a13d22..ab6f95fa 100644 --- a/frontend/components/account/AccountCenter.tsx +++ b/frontend/components/account/AccountCenter.tsx @@ -166,6 +166,7 @@ export function AccountCenter() { } = usePaymentState(); const [showSecondarySections, setShowSecondarySections] = useState(false); const [reconcileBusy, setReconcileBusy] = useState(false); + const [telegramBindUrl, setTelegramBindUrl] = useState(""); const supabaseReady = hasSupabasePublicEnv(); const walletConnectEnabled = Boolean(WALLETCONNECT_PROJECT_ID); @@ -1148,6 +1149,7 @@ export function AccountCenter() { const openTelegramBotBindLink = async () => { setTelegramBindOpening(true); setPaymentError(""); + setTelegramBindUrl(""); const popup = window.open("about:blank", "_blank", "noopener,noreferrer"); try { const authHeaders = await buildAuthedHeaders(true, false); @@ -1164,12 +1166,15 @@ export function AccountCenter() { if (!botUrl) throw new Error("telegram bind link missing"); if (popup && !popup.closed) { popup.location.href = botUrl; + setPaymentInfo( + "已打开 Telegram Bot,请在 Bot 内点击 Start 并确认绑定;完成后刷新本页再申请入群。", + ); } else { - window.open(botUrl, "_blank", "noopener,noreferrer"); + setPaymentInfo( + "弹窗被拦截,请点击下方链接完成绑定:", + ); + setTelegramBindUrl(botUrl); } - setPaymentInfo( - "已打开 Telegram Bot,请在 Bot 内点击 Start 并确认绑定;完成后刷新本页再申请入群。", - ); } catch (error) { if (popup && !popup.closed) popup.close(); setPaymentError(normalizePaymentError(error).message); @@ -2546,6 +2551,16 @@ export function AccountCenter() { {!paymentError && paymentInfo ? (
{paymentInfo} + {telegramBindUrl ? ( + + {telegramBindUrl} + + ) : null}
) : null} {!paymentHostAllowed ? (