Commit c46355bb authored by 智勇's avatar 智勇

权限管理

parent f4fdfc8e
......@@ -42,7 +42,7 @@ const user = {
return new Promise((resolve, reject) => {
getInfo(state.token).then(response => {
const data = response.data
data.roles = data.rank.indexOf('ADMINISTRATOR') !== -1 ? ['admin'] : ['channel']
data.roles = data.rank.indexOf('CHANNEL') !== -1 ? ['channel'] : ['admin']
if (data.roles && data.roles.length > 0) { // 验证返回的roles是否是一个非空数组
commit('SET_ROLES', data.roles)
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment