登录接口

This commit is contained in:
2022-11-22 09:23:48 +08:00
parent b12611faee
commit 419051e921

View File

@@ -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) {