1. 登录模块新增软key登录模块代码

develop
admin 2024-10-31 15:57:10 +08:00
parent 06c3761d05
commit 1a4f1b6734
1 changed files with 29 additions and 27 deletions

View File

@ -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,7 +206,7 @@ function handleLogin4sKey() {
// ukey
async function handleUkeyLogin() {
async function handleUkeyLogin() {
if (!loginFormRef.value) return
loginFormRef.value.validate(async valid => {
if (valid) {
@ -226,8 +226,9 @@ async function handleUkeyLogin() {
}
}
})
}
function checkCapslock({ shiftKey, key }: { shiftKey: boolean; key: string }) {
}
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
@ -238,6 +239,7 @@ function checkCapslock({ shiftKey, key }: { shiftKey: boolean; key: string }) {
if (key === 'CapsLock' && unref(capsTooltip) === true) {
capsTooltip.value = false
}
}
}
</script>