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() })