react-router-dom-v6 配置的路由表 怎么做路由登录和权限判断

发布于 2022-09-30 23:06:12 字数 1562 浏览 15 评论 0

路由表是这样:

const routesConfig = [{
    path:"/",
    ignore:true,
    element:<Main />,
    children:[{
        path:"",
        element: <PersonalCenter />
    }]
},{
    path:"/login",
    ignore:true,
    notLogin:true,
    element:<Login />,
},{
    path:"/personalCenter",
    title: "个人中心",
    icon: <UserOutlined />,
    element: <Main />,
    children: [{
        path: "",
        element: <PersonalCenter />
    }]
}, {
    path: '/authorization',
    title: '权限管理',
    fold: true,
    element: <Main />,
    children: authorizationRoutes
}, {
        path: '/application',
        title: '应用管理',
        fold:true,
        element: <Main />,
        children: applicationRouters
    },
    {
        path: '/vip',
        title: '会员管理',
        fold:true,
        element: <Main />,
        children: vipManagementRouters
    },
   
    {
        path: '/ihu',
        title: 'ihu',
        fold:true,
        element: <Main />,
        children: IHURouters
    },
     {
        path: '/themeManagement',
        title: '主题管理',
        fold:true,
        element: <Main />,
        children: themeManagementRouters
    },
 
 {
    ignore: true,
    fold: true,
    path: '/systemSetting',
    title: '系统设置',
    element: <Main />,
    children: authorizationRoutes
}
, {
    path: '/error',
    title: '错误',
    notLogin:true,
    ignore: true,
    element: <Error />
}, {
    path: '*',
    notLogin:true,
    element: <Error404 />,
}];

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文