fix(@vben/web-antd): 企微扫码登录前校验租户是否已选择
多租户模式下,未选择租户时点击企微扫码登录会触发 租户字段校验提示,避免无租户请求导致后端报错。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user