routes.js
export const routerData = [
{
path: "/",
exact: true,
render: () => <Redirect to="/Home" />,
},
{
path: "/user/all",
component: lazy(() => import("@/pages/user/All"))
},
{
path: "/user/me",
auth: 1, // 用户权限必须 >=1 才可以访问
component: lazy(() => import("@/pages/user/Me"))
},
{
path: "/admin/controlPanel",
auth: 2, // 用户权限必须 >=2(管理员) 才可以访问
component: lazy(() => import("@/pages/admin/ControlPanel"))
}
]