Browse Source

perf[permission]:set role => roles

Pan 7 years ago
parent
commit
79c7160d01
3 changed files with 3 additions and 3 deletions
  1. 1 1
      README.md
  2. 1 1
      src/store/modules/user.js
  3. 1 1
      src/views/dashboard/index.vue

+ 1 - 1
README.md

@@ -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)

+ 1 - 1
src/store/modules/user.js

@@ -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 - 1
src/views/dashboard/index.vue

@@ -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>