diff --git a/src/views/Login/components/LoginForm.vue b/src/views/Login/components/LoginForm.vue index ef212505..3ffb1305 100644 --- a/src/views/Login/components/LoginForm.vue +++ b/src/views/Login/components/LoginForm.vue @@ -291,10 +291,16 @@ const doSocialLogin = async (type: number) => { await getTenantId() // 如果获取不到,则需要弹出提示,进行处理 if (!authUtil.getTenantId()) { - await message.prompt('请输入租户名称', t('common.reminder')).then(async ({ value }) => { - const res = await LoginApi.getTenantIdByName(value) + try { + const data = await message.prompt('请输入租户名称', t('common.reminder')) + if (data?.action !== 'confirm') throw 'cancel' + const res = await LoginApi.getTenantIdByName(data.value) authUtil.setTenantId(res) - }) + } catch (error) { + if(error === 'cancel') return + } finally { + loginLoading.value = false + } } } // 计算 redirectUri