fix : 修复loading加载
This commit is contained in:
@@ -68,19 +68,18 @@ const handleLogin = (instance) => {
|
|||||||
if (!instance) return
|
if (!instance) return
|
||||||
instance.validate(async (valid, fields) => {
|
instance.validate(async (valid, fields) => {
|
||||||
if (!valid) return
|
if (!valid) return
|
||||||
const loading = ElLoading.service({
|
|
||||||
lock: true,
|
|
||||||
text: '登录中...',
|
|
||||||
background: 'rgba(0, 0, 0, 0.7)',
|
|
||||||
})
|
|
||||||
// 发送请求
|
// 发送请求
|
||||||
await authStore.userLogin(loginForm).then(res => {
|
await authStore.userLogin(loginForm).then(res => {
|
||||||
if (res.code === 1000) {
|
if (res) {
|
||||||
|
ElLoading.service({
|
||||||
|
lock: true,
|
||||||
|
text: '登录中...',
|
||||||
|
background: 'rgba(0, 0, 0, 0.7)',
|
||||||
|
})
|
||||||
router.push('/')
|
router.push('/')
|
||||||
} else {
|
} else {
|
||||||
getCode()
|
getCode()
|
||||||
}
|
}
|
||||||
loading.close()
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -88,7 +87,11 @@ const handleLogin = (instance) => {
|
|||||||
getCode()
|
getCode()
|
||||||
|
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
ElLoading.service({text: '正在加载系统资源', background: '#409eff', lock: true}).close()
|
ElLoading.service({
|
||||||
|
lock: true,
|
||||||
|
text: '登录中...',
|
||||||
|
background: 'rgba(0, 0, 0, 0.7)',
|
||||||
|
}).close()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user