Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
这个bug,看起来被反馈很多次了,使用最新的ant-design-pro 6版本和umi-max会出现。
目前不确定是umi还是ant-design的问题,bug表现为如果setInitialState只在登录时执行一次,那么即使accesss.ts里面将全部角色都设置为false,也依然无法隐藏菜单,不过点击菜单后,页面会正常显示403。
我这边目前发现可能和setInitialState有关,左侧菜单加载完成之后需要再次setInitialState才能正常隐藏菜单项。所以尝试提交一个改进。
相关问题反馈:
#10103