index.ts 1.2 KB

1234567891011121314151617181920212223242526272829
  1. import { createRouter, createWebHistory, RouteRecordRaw, createWebHashHistory, Router } from 'vue-router';
  2. import { useAppStore } from '@/stores/index';
  3. import appSetting from '@/app-setting';
  4. const constantRouterMap: RouteRecordRaw[] = [
  5. { path: '/login', component: () => import('@/views/auth/boxed-signin.vue') },
  6. /* { path: '/franchise/login', component: () => import('@/views/login/index.vue'), hidden: true },
  7. { path: '/404', component: () => import('@/views/errorPage/404.vue'), hidden: true },
  8. { path: '/401', component: () => import('@/views/errorPage/401.vue'), hidden: true },
  9. { path: '/payType', component: () => import('@/components/payType.vue'), hidden: false }, */
  10. ];
  11. const router = createRouter({
  12. history: createWebHistory(),
  13. scrollBehavior: () => ({ y: 0 }),
  14. routes: constantRouterMap
  15. })
  16. const asyncRouterMap: RouteRecordRaw[] = [
  17. {
  18. path: '/',
  19. redirect: '/dashboard',
  20. name: 'dashboard',
  21. children: [
  22. { path: 'dashboard', component: () => import('@/views/index.vue'), name: 'dashboard', meta: { title: 'home', icon: 'dashboard' } }
  23. ]
  24. },
  25. ]
  26. export { constantRouterMap, asyncRouterMap };
  27. export default router;