This commit is contained in:
Pan
2017-08-23 11:16:54 +08:00
committed by 花裤衩
parent 33a4369cd7
commit 385ec5a762
18 changed files with 34 additions and 113 deletions

View File

@@ -115,10 +115,16 @@ const user = {
// 动态修改权限
ChangeRole({ commit }, role) {
return new Promise(resolve => {
commit('SET_ROLES', [role])
commit('SET_TOKEN', role)
setToken(role)
resolve()
getInfo(role).then(response => {
const data = response.data
commit('SET_ROLES', data.role)
commit('SET_NAME', data.name)
commit('SET_AVATAR', data.avatar)
commit('SET_INTRODUCTION', data.introduction)
resolve()
})
})
}
}