index.ts 967 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import { createRouter, createWebHistory } from 'vue-router';
  2. import { AccountGuard } from '@/router/account.guard.ts';
  3. const router = createRouter({
  4. history: createWebHistory(import.meta.env.BASE_URL),
  5. routes: [
  6. {
  7. path: '/login',
  8. name: 'login',
  9. component: () => import('@/pages/LoginPage.vue'),
  10. beforeEnter: [AccountGuard.revoke],
  11. },
  12. {
  13. path: '/',
  14. children: [
  15. {
  16. path: 'home',
  17. name: 'home',
  18. component: () => import('@/pages/HomePage.vue'),
  19. meta: { title: '' },
  20. },
  21. {
  22. path: `step/:mode`,
  23. component: () => import(`@/pages/StepPage.vue`),
  24. children: [
  25. {
  26. path: ':value',
  27. component: () => import('@/module/step/Step.vue'),
  28. },
  29. ],
  30. },
  31. ],
  32. beforeEnter: [AccountGuard.grant],
  33. },
  34. { path: '', redirect: '/home' },
  35. ],
  36. });
  37. export default router;