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

解决access权限配置失效,菜单无法隐藏的bug #10205

Closed
wants to merge 3 commits into from

Conversation

hb1707
Copy link

@hb1707 hb1707 commented Sep 6, 2022

这个bug,看起来被反馈很多次了,使用最新的ant-design-pro 6版本和umi-max会出现。
目前不确定是umi还是ant-design的问题,bug表现为如果setInitialState只在登录时执行一次,那么即使accesss.ts里面将全部角色都设置为false,也依然无法隐藏菜单,不过点击菜单后,页面会正常显示403。
我这边目前发现可能和setInitialState有关,左侧菜单加载完成之后需要再次setInitialState才能正常隐藏菜单项。所以尝试提交一个改进。
相关问题反馈:
#10103

@github-actions
Copy link

github-actions bot commented Sep 6, 2022

⚡️ Deploying PR Preview...

@chenshuai2144
Copy link
Collaborator

有点hack,而且看不懂为啥。是因为数据更新不及时吗?

@chenshuai2144
Copy link
Collaborator

umijs/umi#9410

看这里

@zhouquan2016
Copy link

我的是国际化文件设置一下菜单名称就好了

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

Successfully merging this pull request may close these issues.

3 participants