- Implemented store and logged states

This commit is contained in:
Alexis
2020-07-06 21:22:03 +02:00
parent 27ab62e36f
commit 9b10cd473e
6 changed files with 68 additions and 6 deletions

View File

@@ -52,9 +52,13 @@ export default {
"password": this.password
})
.then(v => {
this.$cookies.set("U_", v.data.user, 60 * 60 * 24 * 30)
let user = v.data.user
this.$cookies.set("U_", user, 60 * 60 * 24 * 30)
this.$store.commit('loginSucceed', user)
this.$router.push('/profil')
})
.catch(err => {
this.$store.commit('loginFailed')
console.log(err)
})
}