登录接口
This commit is contained in:
@@ -43,7 +43,9 @@ export default {
|
|||||||
async loginApi () {
|
async loginApi () {
|
||||||
try {
|
try {
|
||||||
let res = await loginApi(this.loginname, encrypt(this.password))
|
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.$router.push('/home')
|
||||||
this.disabled = false
|
this.disabled = false
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|||||||
Reference in New Issue
Block a user