From 84a2d4ce06621111d4bfef9557eb8f91e0236130 Mon Sep 17 00:00:00 2001 From: "2569718930@qq.com" <2569718930@qq.com> Date: Wed, 20 May 2026 19:48:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=81=A2=E5=A4=8D=E5=B8=81=E5=AE=89=E6=B3=A8?= =?UTF-8?q?=E5=85=A5=E6=8F=90=E4=BE=9B=E8=80=85=E5=88=97=E8=A1=A8=E4=BD=86?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20WalletConnect=20=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=EF=BC=8C=E6=9B=B4=E6=96=B0=E6=94=AF=E4=BB=98=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/components/account/AccountCenter.tsx | 10 +++++----- .../components/account/__tests__/paymentShell.test.ts | 11 +++++++++++ 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/frontend/components/account/AccountCenter.tsx b/frontend/components/account/AccountCenter.tsx index b0a1ac70..65df24f5 100644 --- a/frontend/components/account/AccountCenter.tsx +++ b/frontend/components/account/AccountCenter.tsx @@ -480,9 +480,6 @@ function listInjectedProviders(): InjectedProviderOption[] { candidates.forEach((provider, index) => { const detail = detailByProvider.get(provider); const label = detectWalletLabel(provider, detail); - // Binance Web3 Wallet injected provider does not support eth_sendTransaction; - // users should use WalletConnect mode instead. - if (label.toLowerCase().includes("binance")) return; const key = getInjectedProviderStableId(provider, index, detail); if (seen.has(key)) return; const normalizedLabel = label.trim().toLowerCase(); @@ -2040,6 +2037,9 @@ export function AccountCenter() { ); const eth = providerSelection.provider; const walletLabel = providerSelection.label; + const binanceBindHint = walletLabel.toLowerCase().includes("binance") + ? " Binance 扩展已绑定;如支付卡住,请优先使用 WalletConnect 扫码支付。" + : ""; // Ensure we have a valid token BEFORE opening the wallet modal. let accessToken: string; @@ -2071,7 +2071,7 @@ export function AccountCenter() { setWalletAddress(address); setSelectedWallet(address); setPaymentInfo( - `${walletLabel} 已绑定: ${shortAddress(address)}。现在可点击“立即订阅并激活服务”。`, + `${walletLabel} 已绑定: ${shortAddress(address)}。${binanceBindHint || "现在可点击“立即订阅并激活服务”。"}`, ); await Promise.all([loadSnapshot(), loadPaymentSnapshot()]); if (options.openOverlayAfterBind) setShowOverlay(true); @@ -2110,7 +2110,7 @@ export function AccountCenter() { } setPaymentInfo( - `${walletLabel} 绑定成功: ${shortAddress(address)}。现在可点击“立即订阅并激活服务”。`, + `${walletLabel} 绑定成功: ${shortAddress(address)}。${binanceBindHint || "现在可点击“立即订阅并激活服务”。"}`, ); setProviderMode(providerSelection.mode); if (options.openOverlayAfterBind) setShowOverlay(true); diff --git a/frontend/components/account/__tests__/paymentShell.test.ts b/frontend/components/account/__tests__/paymentShell.test.ts index a525f687..7387fc1d 100644 --- a/frontend/components/account/__tests__/paymentShell.test.ts +++ b/frontend/components/account/__tests__/paymentShell.test.ts @@ -32,4 +32,15 @@ export function runTests() { !/STATIC_ASSETS\s*=\s*\[[^\]]*["']\/_next\//s.test(serviceWorkerSource), "service worker must not cache-first the whole /_next/ tree; stale chunks break checkout after deploys", ); + assert( + !/label\.toLowerCase\(\)\.includes\(["']binance["']\)\)\s*return/.test( + accountCenterSource, + ), + "Binance Web3 Wallet injected provider must remain available for browser-extension binding", + ); + assert( + accountCenterSource.includes("Binance 扩展已绑定") && + accountCenterSource.includes("如支付卡住,请优先使用 WalletConnect 扫码支付"), + "Binance extension binding must show a WalletConnect fallback hint for payment stability", + ); }