From 5ca9aa00aa805535a102b422b32beb30fc21f6f3 Mon Sep 17 00:00:00 2001 From: jacy <18049821889@163.com> Date: Mon, 17 Aug 2026 23:22:04 +0800 Subject: [PATCH] =?UTF-8?q?fix(h5-partner):=20=E5=BE=AE=E4=BF=A1OAuth?= =?UTF-8?q?=E5=9B=9E=E8=B7=B3=E9=94=99=E8=AF=AF=E4=B8=8D=E5=86=8D=E5=90=9E?= =?UTF-8?q?=E6=B2=A1=EF=BC=8CDISABLED=E6=8F=90=E7=A4=BA=E5=8F=AF=E8=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 合伙人端 PartnerSessionContext 微信回跳 catch 原把后端 「该账号已暂停使用,请联系客服人员」错误整体吞掉,导致 DISABLED 账号微信登录无任何反馈 - 改为用 toastError 显式提示,与短信路径一致(微信同理) Co-Authored-By: WorkBuddy --- apps/h5-partner/src/contexts/PartnerSessionContext.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/h5-partner/src/contexts/PartnerSessionContext.tsx b/apps/h5-partner/src/contexts/PartnerSessionContext.tsx index 197c14f..80438ad 100644 --- a/apps/h5-partner/src/contexts/PartnerSessionContext.tsx +++ b/apps/h5-partner/src/contexts/PartnerSessionContext.tsx @@ -20,6 +20,7 @@ import { } from '../lib/api'; import { fetchClientConfig, processPartnerWechatOAuthCallback } from '../lib/wechat-auth'; import { isWechatEnv } from '../lib/weixin'; +import { toastError } from '../lib/toast'; export type PartnerAccount = PartnerMe & { staffRole?: PartnerStaffRole; @@ -115,7 +116,10 @@ export function PartnerSessionProvider({ children }: { children: ReactNode }) { } stripOAuthParamsFromLocation(); } - } catch { + } catch (e) { + // 微信 OAuth 回跳后后端可能因账号暂停(DISABLED)等拒绝登录, + // 必须把错误显式提示出来,否则用户无任何反馈(与短信路径一致)。 + toastError(e instanceof Error ? e.message : '微信登录失败'); stripOAuthParamsFromLocation(); } }