Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
523 views
in Technique[技术] by (71.8m points)

vue动态路由权限控制如何实现

系统要进行权限控制,根据不同的角色访问不同的菜单,现在前端要对路由进行权限控制,根据后台返回的菜单路径识别哪些路由访问,现在有个问题是后台返回的只是菜单路由,像编辑页面这些子路由无法获取。因为角色权限是用户自由配置的,不是固定的角色所以不能对应生成固定的菜单,所以请教下像这种动态的路由权限控制如何实现?烦请各位大神指导~


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

详细到按钮的话,登录接口返回一个状态判断有没有编辑权限;

在元信息加个字段,每个页面获取下,在判断
image.png


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...