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

有没有针对不同用户设置的不同权限,然后显示不同的菜单栏呢? #160

Closed
wentao978 opened this issue Apr 1, 2017 · 8 comments

Comments

@wentao978
Copy link

No description provided.

@zuiidea
Copy link
Owner

zuiidea commented Apr 1, 2017

进行中..

@zlotus
Copy link
Contributor

zlotus commented Apr 13, 2017

作者已经在model/app里设置userPermissions了,之后effects.login也返回userPermissions了,并且在reducers.loginSuccess中做了更新,所以理论上功能已经非常完备了 ~ 这个脚手架考虑的很周到 ~ 怒赞啊 ~

我是这么改的:

  • routes/app里多获取一个userPermissions属性;
  • 把该属性写进siderProps,就可以向下传入components/Layout/Sider了;
  • 再把该属性写进menusProps,就可以向下传入components/Layout/Menus了;
  • 最后把components/Layout/Menus里的getMenus稍微修改一下,判断item.key是否在userPermissions里,不在的话直接return就可以了~

一开始设计的好,改起来都特别顺:D
感谢作者 ~

@zuiidea
Copy link
Owner

zuiidea commented Apr 13, 2017

@zlotus 路由,菜单,面包屑,权限的关系还得理一下...

@zlotus
Copy link
Contributor

zlotus commented Apr 15, 2017

@zuiidea 入门JS很多地方不懂…谢谢 ~ 期待下一个版本的更新 ~

@zuiidea
Copy link
Owner

zuiidea commented Jul 5, 2017

#384

@zuiidea zuiidea closed this as completed Jul 5, 2017
@timotanhong
Copy link

权限在客户端控制有安全问题吧

@kevin50ster
Copy link

我也认为前端权限资源登陆成功后从后端获取,前端对角色的权限设置保存在后端,这样比较合适。

@zuiidea
Copy link
Owner

zuiidea commented Jul 21, 2017

@timotanhong @kevin50ster #384 就是从后端获取啊

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

5 participants