From 215998dc664efa6a71965c24ae87e1976727cb87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E4=BC=A0=E9=BE=99?= Date: Sun, 17 Jul 2022 20:37:44 +0800 Subject: [PATCH] perf: optimize login page --- src/views/login/index.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 992773b..b972aeb 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -37,7 +37,7 @@
- 登录 + 登录
@@ -71,6 +71,7 @@ function initLoginInfo() { } const isRemember = useStorage('isRemember', false) +const loging = ref(false) async function handleLogin() { const { name, password } = loginInfo.value if (!name || !password) { @@ -79,6 +80,7 @@ async function handleLogin() { } try { $message.loading('正在验证...') + loging.value = true const res = await login({ name, password: password.toString() }) if (res.code === 0) { $message.success('登录成功') @@ -101,6 +103,7 @@ async function handleLogin() { } catch (error) { $message.error(error.message) } + loging.value = false }