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