routes.js

  1. export const routerData = [
  2. {
  3. path: "/",
  4. exact: true,
  5. render: () => <Redirect to="/Home" />,
  6. },
  7. {
  8. path: "/user/all",
  9. component: lazy(() => import("@/pages/user/All"))
  10. },
  11. {
  12. path: "/user/me",
  13. auth: 1, // 用户权限必须 >=1 才可以访问
  14. component: lazy(() => import("@/pages/user/Me"))
  15. },
  16. {
  17. path: "/admin/controlPanel",
  18. auth: 2, // 用户权限必须 >=2(管理员) 才可以访问
  19. component: lazy(() => import("@/pages/admin/ControlPanel"))
  20. }
  21. ]