Browse Source

Merge branch 'master' of http://121.42.53.174:3000/luyanan/touchwave
xiuz

lipengtao 6 years ago
parent
commit
1dc5ca1057
2 changed files with 3 additions and 3 deletions
  1. 2 2
      src/permission.js
  2. 1 1
      src/views/layout/components/TopNavbar.vue

+ 2 - 2
src/permission.js

@ -23,7 +23,7 @@ router.beforeEach((to, from, next) => {
23 23
      NProgress.done()
24 24
    } else {
25 25
      if (store.getters.roles.length === 0) { // 判断当前用户是否已拉取完user_info信息
26
        console.log(5555)
26
        // console.log(5555)
27 27
        store.dispatch('GetUserInfo').then(res => { // 拉取user_info
28 28
          const roles = [res.data.type.toString()]
29 29
          store.dispatch('GenerateRoutes', { roles }).then(() => { // 根据roles权限生成可访问的路由表
@ -37,7 +37,7 @@ router.beforeEach((to, from, next) => {
37 37
          })
38 38
        })
39 39
      } else {
40
        console.log(4444)
40
        // console.log(4444)
41 41
        if (hasPermission(store.getters.roles, to.meta.roles)) {
42 42
          next()
43 43
        }

+ 1 - 1
src/views/layout/components/TopNavbar.vue

@ -52,7 +52,7 @@ export default {
52 52
      'roles'
53 53
    ])
54 54
  },
55
  watch:{
55
  watch: {
56 56
    '$route'(to, from) {
57 57
      if (this.$route.path === '/') {
58 58
        this.showName = ''