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

前后端是如何结合的? #4

Open
JoeeeeeWu opened this issue Dec 22, 2018 · 3 comments
Open

前后端是如何结合的? #4

JoeeeeeWu opened this issue Dec 22, 2018 · 3 comments

Comments

@JoeeeeeWu
Copy link

在后端设置了是否有某些菜单或者页面的添加、编辑等权限之后,那如何让前端也体现在页面上的呢?demo都没有体现这个,前端都不知道你有哪些权限

@JoeeeeeWu
Copy link
Author

能不能给一个完整的demo看一下

@lmxdawn
Copy link
Owner

lmxdawn commented Dec 24, 2018

前端的路由菜单(router)里面有权限字段(authRule),这个跟你在权限管理里面添加的权限规则名 是一致的,这里就是菜单的控制权限。如果你需要某个按钮的权限在前端页面提现出来,则可以根据 store 存储的 routers 这个数组去循环查找这个按钮是否有权限,有则显示出来,这个按钮的权限名称肯定是固定的,已经确定了的。

@JoeeeeeWu
Copy link
Author

JoeeeeeWu commented Dec 25, 2018

前端的路由菜单(router)里面有权限字段(authRule),这个跟你在权限管理里面添加的权限规则名 是一致的,这里就是菜单的控制权限。如果你需要某个按钮的权限在前端页面提现出来,则可以根据 store 存储的 routers 这个数组去循环查找这个按钮是否有权限,有则显示出来,这个按钮的权限名称肯定是固定的,已经确定了的。

好的,thx

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