登录用户名加密
This commit is contained in:
parent
d04e42ffff
commit
5290ea7de2
|
@ -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(() => {})
|
||||||
})
|
})
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue