Skip to content
New issue

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

权限问题 #10

Open
cnsimplo opened this issue Aug 28, 2018 · 1 comment
Open

权限问题 #10

cnsimplo opened this issue Aug 28, 2018 · 1 comment

Comments

@cnsimplo
Copy link

如果某用户没有访问A页面的权限,但直接在地址栏输入菜单名称就可以访问了,这种非法访问怎么拦截啊?求老大指点... @zzayne

@zzayne
Copy link
Owner

zzayne commented Aug 29, 2018

我回去验证一下,应该不会出现这种情况,没有权限动态路由表里就不会有对应的路由信息,那么即使输入地址,也不会跳转路由和加载组件。你说的这种情况,可以在路由钩子函数里写一个判断规则,如果跳转的路由在用户的权限里则跳转,否则跳转到未授权界面。可以看下官方文档:https://router.vuejs.org/zh/guide/advanced/navigation-guards.html#%E5%85%A8%E5%B1%80%E5%AE%88%E5%8D%AB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants