两次提交
This commit is contained in:
parent
275d1c96e7
commit
6bd5cf1365
|
@ -19,11 +19,11 @@
|
|||
首页
|
||||
</el-dropdown-item>
|
||||
</router-link>
|
||||
<router-link to="/myinfo">
|
||||
<!-- <router-link to="/myinfo">
|
||||
<el-dropdown-item divided>
|
||||
个人中心
|
||||
</el-dropdown-item>
|
||||
</router-link>
|
||||
</router-link> -->
|
||||
<!-- <a target="_blank" href="https://github.com/PanJiaChen/vue-admin-template/">
|
||||
<el-dropdown-item>Github</el-dropdown-item>
|
||||
</a>
|
||||
|
|
|
@ -95,16 +95,29 @@ const actions = {
|
|||
return new Promise((resolve, reject) => {
|
||||
getInfo(state.token).then(response => {
|
||||
const { data } = response
|
||||
const { perms, name, avatar } = data
|
||||
// perms must be a non-empty array
|
||||
if (!perms || perms.length <= 0) {
|
||||
reject('没有任何权限!')
|
||||
if(data){
|
||||
const { perms, name, avatar } = data
|
||||
// perms must be a non-empty array
|
||||
if (!perms || perms.length <= 0) {
|
||||
reject('没有任何权限!')
|
||||
}
|
||||
commit('SET_PERMS', perms)
|
||||
commit('SET_NAME', name)
|
||||
commit('SET_AVATAR', avatar)
|
||||
resolve(data)
|
||||
}else{
|
||||
getInfo(state.token).then(res=>{
|
||||
const { data } = response
|
||||
if (!perms || perms.length <= 0) {
|
||||
reject('没有任何权限!')
|
||||
}
|
||||
commit('SET_PERMS', perms)
|
||||
commit('SET_NAME', name)
|
||||
commit('SET_AVATAR', avatar)
|
||||
resolve(data)
|
||||
})
|
||||
}
|
||||
|
||||
commit('SET_PERMS', perms)
|
||||
commit('SET_NAME', name)
|
||||
commit('SET_AVATAR', avatar)
|
||||
resolve(data)
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue