perf[permission]:set role => roles
This commit is contained in:
parent
c2271d0bf5
commit
79c7160d01
|
@ -30,7 +30,7 @@ npm run build --report
|
|||
![demo](https://github.com/PanJiaChen/PanJiaChen.github.io/blob/master/images/demo.gif)
|
||||
|
||||
## 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
|
||||
[vue-element-admin](https://github.com/PanJiaChen/vue-element-admin)
|
||||
|
|
|
@ -45,7 +45,7 @@ const user = {
|
|||
return new Promise((resolve, reject) => {
|
||||
getInfo(state.token).then(response => {
|
||||
const data = response.data
|
||||
commit('SET_ROLES', data.role)
|
||||
commit('SET_ROLES', data.roles)
|
||||
commit('SET_NAME', data.name)
|
||||
commit('SET_AVATAR', data.avatar)
|
||||
resolve(response)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<div class="dashboard-container">
|
||||
<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>
|
||||
</template>
|
||||
|
||||
|
|
Loading…
Reference in New Issue