From 2c678c3a822ddc795e0a0cd9f190c2b163fc2924 Mon Sep 17 00:00:00 2001 From: lzh Date: Tue, 24 Mar 2026 09:38:05 +0800 Subject: [PATCH] =?UTF-8?q?fix(@vben/web-antd):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E4=BC=81=E4=B8=9A=E5=BE=AE=E4=BF=A1=E6=89=AB=E7=A0=81=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E4=BD=93=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 自动社交登录时显示 loading 状态,跳过租户列表加载, 避免闪烁显示登录表单和租户错误信息。 租户 ID 已持久化在 store 中,无需重新获取。 Co-Authored-By: Claude Opus 4.6 (1M context) --- .../_core/authentication/social-login.vue | 70 ++++++++++++------- 1 file changed, 46 insertions(+), 24 deletions(-) diff --git a/apps/web-antd/src/views/_core/authentication/social-login.vue b/apps/web-antd/src/views/_core/authentication/social-login.vue index fea7df5ea..93f50c9db 100644 --- a/apps/web-antd/src/views/_core/authentication/social-login.vue +++ b/apps/web-antd/src/views/_core/authentication/social-login.vue @@ -137,11 +137,19 @@ async function handleVerifySuccess({ captchaVerification }: any) { } } -/** 组件挂载时获取租户信息 */ -onMounted(async () => { - await fetchTenantList(); +// 是否正在自动社交登录(有 code 说明是 OAuth 回调,直接登录无需展示表单) +const isAutoSocialLogin = ref(!!socialCode); - await tryLogin(); +/** 组件挂载时 */ +onMounted(async () => { + if (socialCode) { + // 自动社交登录:跳过租户列表加载(tenantId 已持久化在 store 中) + await tryLogin(); + return; + } + // 手动登录绑定:需要展示表单和租户列表 + isAutoSocialLogin.value = false; + await fetchTenantList(); }); const formSchema = computed((): VbenFormSchema[] => { @@ -198,25 +206,39 @@ const formSchema = computed((): VbenFormSchema[] => {