fix(LoginForm): 🐞 update doSocialLogin

- 修复手动填写租户名称时,点击取消按钮,登录按钮 loading 状态未取消,并且会继续执行 LoginApi.socialAuthRedirect 方法
This commit is contained in:
AhJindeg 2024-03-07 14:38:31 +08:00
parent 1a5e7902b8
commit 2d4ed85e94

View File

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