From 565c976f7f09e70d4a4aaa1a6d2011da8f2f473f Mon Sep 17 00:00:00 2001 From: odjbin <1042039504@qq.com> Date: Tue, 5 Mar 2024 22:13:36 +0800 Subject: [PATCH] =?UTF-8?q?fix=20:=20=E4=BF=AE=E5=A4=8Dloading=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/login/index.vue | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 1656965..f216894 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -68,19 +68,18 @@ const handleLogin = (instance) => { if (!instance) return instance.validate(async (valid, fields) => { if (!valid) return - const loading = ElLoading.service({ - lock: true, - text: '登录中...', - background: 'rgba(0, 0, 0, 0.7)', - }) // 发送请求 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('/') } else { getCode() } - loading.close() }) }) } @@ -88,7 +87,11 @@ const handleLogin = (instance) => { getCode() onBeforeUnmount(() => { - ElLoading.service({text: '正在加载系统资源', background: '#409eff', lock: true}).close() + ElLoading.service({ + lock: true, + text: '登录中...', + background: 'rgba(0, 0, 0, 0.7)', + }).close() })