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

develop
admin 2024-10-31 15:43:39 +08:00
parent 33c491befa
commit 06c3761d05
1 changed files with 9 additions and 2 deletions

View File

@ -120,7 +120,10 @@ const activeName = ref('UKEY')
const loginForm = reactive({ const loginForm = reactive({
account: '', account: '',
password: '', password: '',
ukeyPassword: '' ukeyPassword: '',
saccount: '',
spassword: ''
}) })
const remember = ref(false) const remember = ref(false)
const loading = ref(false) const loading = ref(false)
@ -136,6 +139,8 @@ const init = () => {
const obj = JSON.parse(local) const obj = JSON.parse(local)
loginForm.account = obj.account loginForm.account = obj.account
loginForm.password = decrypt(obj.password) loginForm.password = decrypt(obj.password)
loginForm.saccount = obj.saccount
loginForm.spassword = decrypt(obj.spassword)
remember.value = true remember.value = true
} }
} }
@ -147,7 +152,9 @@ function goLogin(data: any) {
if (unref(remember)) { if (unref(remember)) {
const obj = { const obj = {
account: loginForm.account, account: loginForm.account,
password: encrypt(loginForm.password) password: encrypt(loginForm.password),
saccount: loginForm.saccount,
spassword: encrypt(loginForm.spassword)
} }
localStorage.setItem('cmcLoginData', JSON.stringify(obj)) localStorage.setItem('cmcLoginData', JSON.stringify(obj))
} else { } else {