refine
This commit is contained in:
@@ -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()
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user