index.ts 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router";
  2. import { authGuard } from './plugins/authGuard'
  3. const routes: RouteRecordRaw[] = [
  4. {
  5. path: "/",
  6. redirect: "/photography/check"
  7. },
  8. {
  9. path: "/home",
  10. name: "home",
  11. component: () => import("@/views/Home/index.vue"),
  12. meta: {
  13. noAuth: true,
  14. },
  15. },
  16. {
  17. path: "/setting",
  18. name: "setting",
  19. component: () => import("@/views/Setting/index.vue"),
  20. meta: {
  21. title: '设置'
  22. }
  23. },
  24. {
  25. path: "/photography/check",
  26. name: "PhotographyCheck",
  27. component: () => import("@/views/Photography/check.vue"),
  28. meta: {
  29. title: '拍摄物体镜头矫正'
  30. }
  31. },
  32. {
  33. path: "/photography/shot",
  34. name: "PhotographyShot",
  35. component: () => import("@/views/Photography/shot.vue"),
  36. meta: {
  37. title: '拍摄商品'
  38. }
  39. },
  40. {
  41. path: "/photography/detail",
  42. name: "PhotographyDetail",
  43. component: () => import("@/views/Photography/detail.vue"),
  44. meta: {
  45. title: '主图与详情生成'
  46. }
  47. },
  48. {
  49. path: "/photography/seniorDetail",
  50. name: "PhotographySeniorDetail",
  51. component: () => import("@/views/Photography/seniorDetail.vue"),
  52. meta: {
  53. title: '详情高级配置'
  54. }
  55. },
  56. ];
  57. const router = createRouter({
  58. history: createWebHashHistory(), // 修改: 将 createWebHistory 改为 createWebHashHistory
  59. routes
  60. });
  61. authGuard(router)
  62. export default router;