fix(@vben/web-antd): 企微扫码登录前校验租户是否已选择

多租户模式下,未选择租户时点击企微扫码登录会触发
租户字段校验提示,避免无租户请求导致后端报错。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
lzh
2026-03-24 09:44:21 +08:00
parent 2c678c3a82
commit 9c822ba9d9
2 changed files with 8 additions and 1 deletions

View File

@@ -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

View File

@@ -213,7 +213,7 @@ const formSchema = computed((): VbenFormSchema[] => {
>
<div
class="mb-4 size-8 animate-spin rounded-full border-4 border-primary border-t-transparent"
/>
></div>
<span class="text-sm text-muted-foreground">正在登录中...</span>
</div>