diff --git a/back/src/views/pages/login.vue b/back/src/views/pages/login.vue index a06333dc..1acbe06f 100644 --- a/back/src/views/pages/login.vue +++ b/back/src/views/pages/login.vue @@ -110,12 +110,12 @@ export default { this.$message.error('登陆失败,用户名或密码错误!') 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) { this.getCaptcha() 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' }) }).catch(() => {}) }) diff --git a/front/src/views/login/index.vue b/front/src/views/login/index.vue index 7440960f..45c5a99f 100644 --- a/front/src/views/login/index.vue +++ b/front/src/views/login/index.vue @@ -155,14 +155,10 @@ } await this.login({ password: Encrypt(this.form.password), - username: this.form.username, + username: Encrypt(this.form.username), }) // window.localStorage.setItem('tokenStartTime', new Date().getTime()) window.sessionStorage.setItem('visits', JSON.stringify([])) - console.log( - '添加visits========================================>', - Cookies.get('ucsToken') - ) // console.log(this.handleRoute()) // 西海岸特殊处理 if (isXiHaiAn) {