perf[permission]:set role => roles

This commit is contained in:
Pan 2018-01-05 13:21:14 +08:00
parent c2271d0bf5
commit 79c7160d01
3 changed files with 3 additions and 3 deletions

View File

@ -30,7 +30,7 @@ npm run build --report
![demo](https://github.com/PanJiaChen/PanJiaChen.github.io/blob/master/images/demo.gif) ![demo](https://github.com/PanJiaChen/PanJiaChen.github.io/blob/master/images/demo.gif)
## Extra ## Extra
If you want router permission && generate menu by user role , you can use this branch [permission-control](https://github.com/PanJiaChen/vueAdmin-template/tree/permission-control) If you want router permission && generate menu by user roles , you can use this branch [permission-control](https://github.com/PanJiaChen/vueAdmin-template/tree/permission-control)
## Related Project ## Related Project
[vue-element-admin](https://github.com/PanJiaChen/vue-element-admin) [vue-element-admin](https://github.com/PanJiaChen/vue-element-admin)

View File

@ -45,7 +45,7 @@ const user = {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
getInfo(state.token).then(response => { getInfo(state.token).then(response => {
const data = response.data const data = response.data
commit('SET_ROLES', data.role) commit('SET_ROLES', data.roles)
commit('SET_NAME', data.name) commit('SET_NAME', data.name)
commit('SET_AVATAR', data.avatar) commit('SET_AVATAR', data.avatar)
resolve(response) resolve(response)

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="dashboard-container"> <div class="dashboard-container">
<div class="dashboard-text">name:{{name}}</div> <div class="dashboard-text">name:{{name}}</div>
<div class="dashboard-text">role:<span v-for='role in roles' :key='role'>{{role}}</span></div> <div class="dashboard-text">roles:<span v-for='role in roles' :key='role'>{{role}}</span></div>
</div> </div>
</template> </template>