next() | next() | ||||
} | } | ||||
} else { | } else { | ||||
console.log(store.state.user.roles) | |||||
if (!store.state.user.roles) { | if (!store.state.user.roles) { | ||||
if (!store.state.user.info) { | if (!store.state.user.info) { | ||||
await store.dispatch('user/getInfo') | await store.dispatch('user/getInfo') | ||||
if (to.name == '403') { | if (to.name == '403') { | ||||
store.dispatch('user/setIsIndexTag', false) | store.dispatch('user/setIsIndexTag', false) | ||||
} | } | ||||
}else{ | |||||
store.dispatch('user/resetToken') | |||||
} | } | ||||
next() | next() | ||||
} else { | } else { |
created() { | created() { | ||||
this.browser=this.isIE() | this.browser=this.isIE() | ||||
this.height = document.body.clientHeight - 120 | this.height = document.body.clientHeight - 120 | ||||
this.filterMenu() | |||||
this.pageSize = parseInt((document.body.clientHeight - 344) / 50) | this.pageSize = parseInt((document.body.clientHeight - 344) / 50) | ||||
this.initConfig() | this.initConfig() | ||||
this.initPassword() | this.initPassword() | ||||
return this.$store.state.user.isIndexTag | return this.$store.state.user.isIndexTag | ||||
}, | }, | ||||
getInfo() { | getInfo() { | ||||
if(this.$store.state.user.info){ | |||||
this.filterMenu() | |||||
} | |||||
return this.$store.state.user.info | return this.$store.state.user.info | ||||
} | } | ||||
}, | }, |