Initial commit

This commit is contained in:
Torsten Schulz
2024-07-17 22:24:56 +02:00
commit 3880a265eb
126 changed files with 10959 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
import { createRouter, createWebHistory } from 'vue-router';
import HomeView from '../views/HomeView.vue';
const routes = [
{
path: '/',
name: 'Home',
component: HomeView
}
];
const router = createRouter({
history: createWebHistory(process.env.BASE_URL),
routes
});
router.beforeEach((to, from, next) => {
if (to.matched.some(record => record.meta.requiresAuth)) {
if (!store.getters.isLoggedIn) {
next('/');
} else {
next();
}
} else {
next();
}
});
export default router;