base.ts 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import Layout from "@/layout/layout.vue";
  2. import Error from "@/views/error.vue";
  3. import { RouteRecordRaw } from "vue-router";
  4. import Login from "@/views/login.vue";
  5. import Iframe from "@/views/iframe.vue";
  6. /**
  7. * 框架基础路由
  8. */
  9. const routes: Array<RouteRecordRaw> = [
  10. {
  11. path: "/",
  12. component: Layout,
  13. redirect: "/home",
  14. meta: { title: "工作台", icon: "icon-desktop" },
  15. children: [
  16. {
  17. path: "/home",
  18. component: () => import("@/views/home.vue"),
  19. meta: { title: "主页", icon: "icon-home" }
  20. }
  21. ]
  22. },
  23. {
  24. path: "/login",
  25. component: Login,
  26. meta: { title: "登录", isNavigationMenu: false }
  27. },
  28. {
  29. path: "/user/password",
  30. component: () => import("@/views/sys/user-update-password.vue"),
  31. meta: { title: "修改密码", requiresAuth: true, isNavigationMenu: false }
  32. },
  33. {
  34. path: "/iframe/:id?",
  35. component: Iframe,
  36. meta: { title: "iframe", isNavigationMenu: false }
  37. },
  38. {
  39. path: "/error",
  40. name: "error",
  41. component: Error,
  42. meta: { title: "错误页面", isNavigationMenu: false }
  43. },
  44. {
  45. path: "/:path(.*)*",
  46. redirect: { path: "/error", query: { to: 404 }, replace: true },
  47. meta: { isNavigationMenu: false }
  48. }
  49. ];
  50. export default routes;