From 9c822ba9d917294829fcd65eb636a4dddce53949 Mon Sep 17 00:00:00 2001 From: lzh Date: Tue, 24 Mar 2026 09:44:21 +0800 Subject: [PATCH] =?UTF-8?q?fix(@vben/web-antd):=20=E4=BC=81=E5=BE=AE?= =?UTF-8?q?=E6=89=AB=E7=A0=81=E7=99=BB=E5=BD=95=E5=89=8D=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E7=A7=9F=E6=88=B7=E6=98=AF=E5=90=A6=E5=B7=B2=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 多租户模式下,未选择租户时点击企微扫码登录会触发 租户字段校验提示,避免无租户请求导致后端报错。 Co-Authored-By: Claude Opus 4.6 (1M context) --- apps/web-antd/src/views/_core/authentication/login.vue | 7 +++++++ .../src/views/_core/authentication/social-login.vue | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/web-antd/src/views/_core/authentication/login.vue b/apps/web-antd/src/views/_core/authentication/login.vue index d83aa3cee..7145c4789 100644 --- a/apps/web-antd/src/views/_core/authentication/login.vue +++ b/apps/web-antd/src/views/_core/authentication/login.vue @@ -96,6 +96,13 @@ async function handleThirdLogin(type: number) { if (type <= 0) { return; } + // 多租户模式下,必须先选择租户 + if (tenantEnable && !accessStore.tenantId) { + loginRef.value + ?.getFormApi() + .setFieldValue('tenantId', undefined, false); + return; + } try { // hash 路由模式下,OAuth 回调的 code 在 URL query 中,Vue Router 读不到 // 通过 sessionStorage 传递参数,redirect_uri 只用 origin 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 93f50c9db..0e632018a 100644 --- a/apps/web-antd/src/views/_core/authentication/social-login.vue +++ b/apps/web-antd/src/views/_core/authentication/social-login.vue @@ -213,7 +213,7 @@ const formSchema = computed((): VbenFormSchema[] => { >
+ >
正在登录中...