登录用户名加密

This commit is contained in:
a0049873 2022-11-14 16:46:06 +08:00
parent d04e42ffff
commit 5290ea7de2
2 changed files with 3 additions and 7 deletions

View File

@ -110,12 +110,12 @@ export default {
this.$message.error('登陆失败,用户名或密码错误!') this.$message.error('登陆失败,用户名或密码错误!')
return return
} }
this.$http.get('/login', { params: { username: this.dataForm.username, password: Encrypt(this.dataForm.password) } }).then(({ data: res }) => { this.$http.get('/login', { params: { username: Encrypt(this.dataForm.username), password: Encrypt(this.dataForm.password) } }).then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
this.getCaptcha() this.getCaptcha()
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
Cookies.set('ucsToken', res.data.token, { expires: 'session' }) Cookies.set('ucsToken', res.data.token)
this.$router.replace({ path: '/home' }) this.$router.replace({ path: '/home' })
}).catch(() => {}) }).catch(() => {})
}) })

View File

@ -155,14 +155,10 @@
} }
await this.login({ await this.login({
password: Encrypt(this.form.password), password: Encrypt(this.form.password),
username: this.form.username, username: Encrypt(this.form.username),
}) })
// window.localStorage.setItem('tokenStartTime', new Date().getTime()) // window.localStorage.setItem('tokenStartTime', new Date().getTime())
window.sessionStorage.setItem('visits', JSON.stringify([])) window.sessionStorage.setItem('visits', JSON.stringify([]))
console.log(
'添加visits========================================>',
Cookies.get('ucsToken')
)
// console.log(this.handleRoute()) // console.log(this.handleRoute())
// 西 // 西
if (isXiHaiAn) { if (isXiHaiAn) {