diff --git a/src/pages/login/Login.vue b/src/pages/login/Login.vue index 9351e9d..5f6f0bb 100644 --- a/src/pages/login/Login.vue +++ b/src/pages/login/Login.vue @@ -43,7 +43,9 @@ export default { async loginApi () { try { let res = await loginApi(this.loginname, encrypt(this.password)) - this.$store.dispatch('userInfo', JSON.stringify(res)) + let obj = {} + obj = Object.assign({}, res.user.user, {token: res.token}) + this.$store.dispatch('userInfo', JSON.stringify(obj)) this.$router.push('/home') this.disabled = false } catch (err) {