From 1a4f1b67346babe01c2ed516508c78ea0c91f2ba Mon Sep 17 00:00:00 2001 From: admin <592225189@qq.com> Date: Thu, 31 Oct 2024 15:57:10 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E7=99=BB=E5=BD=95=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=BD=AFkey=E7=99=BB=E5=BD=95=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/login/login.vue | 56 ++++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/src/views/login/login.vue b/src/views/login/login.vue index 417e0d1..bdb14b8 100644 --- a/src/views/login/login.vue +++ b/src/views/login/login.vue @@ -192,7 +192,7 @@ function handleLogin4sKey() { loading.value = true const { saccount, spassword } = loginForm const res = await store - .dispatch('skey/Login', {account: saccount, password: spassword}) + .dispatch('skey/Login', { account: saccount, password: spassword }) .finally(() => (loading.value = false)) .catch(() => (loading.value = false)) if (res && res.success) { @@ -206,38 +206,40 @@ function handleLogin4sKey() { // ukey 登录 -async function handleUkeyLogin() { - if (!loginFormRef.value) return - loginFormRef.value.validate(async valid => { - if (valid) { - console.log('UKEY: 密码校验通过') - loading.value = true - const res = await store - .dispatch('ukey/Login', loginForm.ukeyPassword) - .finally(() => (loading.value = false)) - .catch(() => (loading.value = false)) - if (res && res.success) { - console.log('UKEY: 登录成功,云管融合登录接口返回', res) - // 用于保活与监测 ukey 是否拔出 - setUkeyPassword(loginForm.ukeyPassword) - goLogin(res.data) + async function handleUkeyLogin() { + if (!loginFormRef.value) return + loginFormRef.value.validate(async valid => { + if (valid) { + console.log('UKEY: 密码校验通过') + loading.value = true + const res = await store + .dispatch('ukey/Login', loginForm.ukeyPassword) + .finally(() => (loading.value = false)) + .catch(() => (loading.value = false)) + if (res && res.success) { + console.log('UKEY: 登录成功,云管融合登录接口返回', res) + // 用于保活与监测 ukey 是否拔出 + setUkeyPassword(loginForm.ukeyPassword) + goLogin(res.data) + } else { + console.log('UKEY: 登录失败,云管融合登录接口返回', res) + } + } + }) + } + + function checkCapslock({ shiftKey, key }: { shiftKey: boolean; key: string }) { + if (key && key.length === 1) { + if ((shiftKey && key >= 'a' && key <= 'z') || (!shiftKey && key >= 'A' && key <= 'Z')) { + capsTooltip.value = true } else { - console.log('UKEY: 登录失败,云管融合登录接口返回', res) + capsTooltip.value = false } } - }) -} -function checkCapslock({ shiftKey, key }: { shiftKey: boolean; key: string }) { - if (key && key.length === 1) { - if ((shiftKey && key >= 'a' && key <= 'z') || (!shiftKey && key >= 'A' && key <= 'Z')) { - capsTooltip.value = true - } else { + if (key === 'CapsLock' && unref(capsTooltip) === true) { capsTooltip.value = false } } - if (key === 'CapsLock' && unref(capsTooltip) === true) { - capsTooltip.value = false - } }