登录界面:姐姐点击登录后界面疯狂闪动的问题

This commit is contained in:
puhui999 2023-09-09 14:27:48 +08:00
parent 0e2ea39591
commit a79f1452b3

View File

@ -230,6 +230,7 @@ const getCookie = () => {
}
}
}
const loading = ref() // ElLoading.service
//
const handleLogin = async (params) => {
loginLoading.value = true
@ -244,7 +245,7 @@ const handleLogin = async (params) => {
if (!res) {
return
}
ElLoading.service({
loading.value = ElLoading.service({
lock: true,
text: '正在加载系统中...',
background: 'rgba(0, 0, 0, 0.7)'
@ -264,13 +265,9 @@ const handleLogin = async (params) => {
} else {
push({ path: redirect.value || permissionStore.addRouters[0].path })
}
} catch {
loginLoading.value = false
} finally {
setTimeout(() => {
const loadingInstance = ElLoading.service()
loadingInstance.close()
}, 400)
loginLoading.value = false
loading.value.close()
}
}