Skip to content

权限相关,通过角色限制菜单,未起到作用 #297

Open
@chaihao

Description

@chaihao

在路由配置角色验证

   {
      path: 'demo',
      name: '演示页',
      meta: {
        icon: 'file-ppt',
        authority: {
          role: 'test',
        }
      },
      component: () => import('@/pages/demo')
    }

加载菜单仍然会显示,经过筛查,发现 hasPermission方法权限验证通过了,由于 route.meta.pAuthorities 给了 * 的权限,现在想用角色来实现菜单权限控制有什么好的解决办法? 我目前想到的解决办法是在 routerUtil.js文件中在给pAuthorities 赋值时判断 authority 中是否存在 role 限制, 如果存在赋值 pAuthorities 下 permission 值为空字符串,目前测试可以实现预期效果,请问是否有其他方式解决这个问题

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions