2025-05-22 06:56:37 +00:00
|
|
|
// router/index.js
|
|
|
|
import { createRouter, createWebHistory } from 'vue-router';
|
|
|
|
import { setupRouterGuards } from './router-guards';
|
|
|
|
|
|
|
|
const routes = [
|
|
|
|
{
|
|
|
|
path: '/',
|
|
|
|
redirect: 'home'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/home',
|
|
|
|
name: 'home',
|
|
|
|
component: () => import('@/views/home/index.vue'),
|
|
|
|
// beforeEnter: (to, from, next) => {
|
|
|
|
|
|
|
|
// localStorage.clear()
|
|
|
|
// next()
|
|
|
|
// }
|
|
|
|
},
|
|
|
|
{
|
2025-05-22 11:02:50 +00:00
|
|
|
path: '/contacts',
|
|
|
|
name: 'contacts',
|
|
|
|
component: () => import('@/views/contacts/index.vue'),
|
2025-05-22 06:56:37 +00:00
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const router = createRouter({
|
|
|
|
history: createWebHistory(),
|
|
|
|
routes
|
|
|
|
});
|
|
|
|
router.beforeEach((to, from, next) => {
|
|
|
|
if (to.meta?.title) {
|
|
|
|
document.title = to.meta.title;
|
|
|
|
}
|
|
|
|
next()
|
|
|
|
});
|
|
|
|
setupRouterGuards(router);
|
|
|
|
export default router;
|