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[] => {