fix: 解决报错
parent
17e6adf0b2
commit
3783049246
|
@ -8,7 +8,6 @@ export {}
|
|||
declare module '@vue/runtime-core' {
|
||||
export interface GlobalComponents {
|
||||
ElAside: typeof import('element-plus/es')['ElAside']
|
||||
ElAvatar: typeof import('element-plus/es')['ElAvatar']
|
||||
ElBadge: typeof import('element-plus/es')['ElBadge']
|
||||
ElButton: typeof import('element-plus/es')['ElButton']
|
||||
ElCard: typeof import('element-plus/es')['ElCard']
|
||||
|
@ -28,33 +27,20 @@ declare module '@vue/runtime-core' {
|
|||
ElMain: typeof import('element-plus/es')['ElMain']
|
||||
ElMenu: typeof import('element-plus/es')['ElMenu']
|
||||
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
|
||||
ElOption: typeof import('element-plus/es')['ElOption']
|
||||
ElRadio: typeof import('element-plus/es')['ElRadio']
|
||||
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
|
||||
ElRow: typeof import('element-plus/es')['ElRow']
|
||||
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
|
||||
ElSelect: typeof import('element-plus/es')['ElSelect']
|
||||
ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
|
||||
ElSwitch: typeof import('element-plus/es')['ElSwitch']
|
||||
ElTabPane: typeof import('element-plus/es')['ElTabPane']
|
||||
ElTabs: typeof import('element-plus/es')['ElTabs']
|
||||
ElTooltip: typeof import('element-plus/es')['ElTooltip']
|
||||
Empty: typeof import('./components/empty/Empty.vue')['default']
|
||||
IconEpApp: typeof import('~icons/ep/app')['default']
|
||||
IconEpArrowDown: typeof import('~icons/ep/arrow-down')['default']
|
||||
IconEpArrowLeft: typeof import('~icons/ep/arrow-left')['default']
|
||||
IconEpArrowRight: typeof import('~icons/ep/arrow-right')['default']
|
||||
IconEpBell: typeof import('~icons/ep/bell')['default']
|
||||
IconEpBellFill: typeof import('~icons/ep/bell-fill')['default']
|
||||
IconEpBellFilled: typeof import('~icons/ep/bell-filled')['default']
|
||||
IconEpG0ird: typeof import('~icons/ep/g0ird')['default']
|
||||
IconEpGird: typeof import('~icons/ep/gird')['default']
|
||||
IconEpGrid: typeof import('~icons/ep/grid')['default']
|
||||
IconEpHomeFilled: typeof import('~icons/ep/home-filled')['default']
|
||||
IconEpKey: typeof import('~icons/ep/key')['default']
|
||||
IconEpLock: typeof import('~icons/ep/lock')['default']
|
||||
IconEpPlus: typeof import('~icons/ep/plus')['default']
|
||||
IconEpRight: typeof import('~icons/ep/right')['default']
|
||||
IconEpSearch: typeof import('~icons/ep/search')['default']
|
||||
IconEpSwitchButton: typeof import('~icons/ep/switch-button')['default']
|
||||
IconEpUploadFilled: typeof import('~icons/ep/upload-filled')['default']
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
</el-tab-pane>
|
||||
<el-tab-pane label="软KEY登录" name="SKEY">
|
||||
<div v-if="activeName === 'SKEY'">
|
||||
<!-- <div class="login-title">账号登录</div>-->
|
||||
<!-- <div class="login-title">账号登录</div>-->
|
||||
<el-form-item class="login-form-item" prop="saccount" :rules="[{ ...required, message: '请输入用户名' }]">
|
||||
<el-input v-model="loginForm.saccount" autocomplete="off" placeholder="登录账户">
|
||||
<template #prefix>
|
||||
|
@ -112,10 +112,9 @@ import { required } from '@/validate'
|
|||
import { setUkeyPassword } from 'utils/auth'
|
||||
import type { FormInstance } from 'element-plus'
|
||||
|
||||
|
||||
const ukeyPasswordInputRef = ref()
|
||||
onMounted(() => {
|
||||
if (typeof ukeyPasswordInputRef.value.focus === 'function') ukeyPasswordInputRef.value.focus()
|
||||
if (ukeyPasswordInputRef.value && typeof ukeyPasswordInputRef.value.focus === 'function') ukeyPasswordInputRef.value.focus()
|
||||
})
|
||||
const activeName = ref('UKEY')
|
||||
const loginForm = reactive({
|
||||
|
@ -124,7 +123,6 @@ const loginForm = reactive({
|
|||
ukeyPassword: '',
|
||||
saccount: '',
|
||||
spassword: ''
|
||||
|
||||
})
|
||||
const remember = ref(false)
|
||||
const loading = ref(false)
|
||||
|
@ -207,43 +205,41 @@ 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)
|
||||
} 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
|
||||
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 {
|
||||
capsTooltip.value = false
|
||||
console.log('UKEY: 登录失败,云管融合登录接口返回', res)
|
||||
}
|
||||
}
|
||||
if (key === 'CapsLock' && unref(capsTooltip) === true) {
|
||||
})
|
||||
}
|
||||
|
||||
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 {
|
||||
capsTooltip.value = false
|
||||
}
|
||||
}
|
||||
|
||||
if (key === 'CapsLock' && unref(capsTooltip) === true) {
|
||||
capsTooltip.value = false
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
Loading…
Reference in New Issue