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,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
}
}
</script>