Skip to content

Commit a6e29c5

Browse files
YunaiVgitee-org
authored andcommitted
!400 fix(LoginForm): update doSocialLogin
Merge pull request !400 from AhJindeg/dev
2 parents 4dabfcb + 2d4ed85 commit a6e29c5

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)