index.ts 835 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import { createRouter, createWebHistory } from 'vue-router';
  2. import NProgress from 'nprogress'; // progress bar
  3. import 'nprogress/nprogress.css';
  4. import { appRoutes } from './routes';
  5. import { REDIRECT_MAIN, NOT_FOUND_ROUTE } from './routes/base';
  6. import createRouteGuard from './guard';
  7. NProgress.configure({ showSpinner: false }); // NProgress Configuration
  8. const router = createRouter({
  9. history: createWebHistory(),
  10. routes: [
  11. {
  12. path: '/',
  13. redirect: '/financial/remit',
  14. },
  15. {
  16. path: '/login',
  17. name: 'login',
  18. component: () => import('@/views/login/index.vue'),
  19. meta: {
  20. requiresAuth: false,
  21. },
  22. },
  23. ...appRoutes,
  24. REDIRECT_MAIN,
  25. NOT_FOUND_ROUTE,
  26. ],
  27. scrollBehavior() {
  28. return { top: 0 };
  29. },
  30. });
  31. createRouteGuard(router);
  32. export default router;