refactor permission

This commit is contained in:
Pan
2019-03-21 10:58:44 +08:00
parent e1d61898ed
commit 0c6e45e9a1
6 changed files with 83 additions and 71 deletions

View File

@@ -135,13 +135,14 @@ export default {
this.$refs.loginForm.validate(valid => {
if (valid) {
this.loading = true
// dispatch @/store/modules/user login action
this.$store.dispatch('user/login', this.loginForm).then(() => {
this.loading = false
this.$router.push({ path: this.redirect || '/' })
}).catch(() => {
this.loading = false
})
this.$store.dispatch('user/login', this.loginForm)
.then(() => {
this.$router.push({ path: this.redirect || '/' })
this.loading = false
})
.catch(() => {
this.loading = false
})
} else {
console.log('error submit!!')
return false