前端路由级别的鉴权是如何实现的? #4329
Replies: 5 comments 8 replies
-
我想知道有没有类似于UMi的wrapper的设计? |
Beta Was this translation helpful? Give feedback.
-
可以我对DataLoader还没有深入了解,现在不知道怎么实现路由级别甚至组件级别的权限控制 |
Beta Was this translation helpful? Give feedback.
-
在路由组件文件中,在组件外层包裹一个用于鉴权的组件即可。Modern.js 的路由是基于 React Router 6 实现的,所以可以参考 React Router 6 的方式对路由权限进行控制,例如这个 demo |
Beta Was this translation helpful? Give feedback.
-
有内置的插件吗 内置的会方便一点 |
Beta Was this translation helpful? Give feedback.
-
嘻嘻!我通了几晚的宵,可算完成了初版,已全部测试OK了,从零撸了基于路由控制的权限控制,可以兼容原生v6 |
Beta Was this translation helpful? Give feedback.
-
Version
npx envinfo --system --browsers --npmPackages '@modern-js/*'
Details
有没有大佬能提供一下demo?
Reproduce link
无
Reproduce Steps
无
Beta Was this translation helpful? Give feedback.
All reactions