Skip to content

Commit 2d4ed85

Browse files
committed
fix(LoginForm): 🐞 update doSocialLogin
- 修复手动填写租户名称时,点击取消按钮,登录按钮 loading 状态未取消,并且会继续执行 LoginApi.socialAuthRedirect 方法
1 parent 1a5e790 commit 2d4ed85

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/views/Login/components/LoginForm.vue

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,10 +291,16 @@ const doSocialLogin = async (type: number) => {
291291
await getTenantId()
292292
// 如果获取不到,则需要弹出提示,进行处理
293293
if (!authUtil.getTenantId()) {
294-
await message.prompt('请输入租户名称', t('common.reminder')).then(async ({ value }) => {
295-
const res = await LoginApi.getTenantIdByName(value)
294+
try {
295+
const data = await message.prompt('请输入租户名称', t('common.reminder'))
296+
if (data?.action !== 'confirm') throw 'cancel'
297+
const res = await LoginApi.getTenantIdByName(data.value)
296298
authUtil.setTenantId(res)
297-
})
299+
} catch (error) {
300+
if(error === 'cancel') return
301+
} finally {
302+
loginLoading.value = false
303+
}
298304
}
299305
}
300306
// 计算 redirectUri

0 commit comments

Comments
 (0)