We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
const getters = { status: state => state.user.status, username: state => state.user.username, name: state => state.user.name, roles: state => state.user.roles, addRouters: state => state.permission.addRouters }
{ path: "/admin", component: _import('admin/index'), //redirect: '/dashboard', meta:{ role: ['Admin'] }, name: "admin" }
function filterAsyncRouter(asyncRouterMap,roles) { const accessedRouters = asyncRouterMap.filter(route => { if(hasPermission(roles,route)){ if(route.children && route.children.length){ route.children = filterAsyncRouter(route.children,roles) } return true } return false }) return accessedRouters }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
前端要根据用户权限进行路由控制,并对组件进行动态渲染
挑战
解决方案
总结
The text was updated successfully, but these errors were encountered: