landing desktop

This commit is contained in:
2026-06-12 20:16:14 +03:30
parent 820e80ac16
commit 5eec309b54
89 changed files with 4343 additions and 2309 deletions
+8 -5
View File
@@ -1,10 +1,12 @@
import { createRouter, createWebHistory } from 'vue-router';
import { useAuthStore } from '@/stores/auth';
import { useProfileModalStore } from '@/stores/profile-modal';
import { loginRouteWithRedirect } from '@/utils/auth-redirect';
const router = createRouter({
history: createWebHistory(),
routes: [
{ path: '/', redirect: '/login' },
{ path: '/', redirect: '/app' },
{
path: '/login',
name: 'login',
@@ -21,13 +23,11 @@ const router = createRouter({
path: '/app',
name: 'app-home',
component: () => import('@/views/app/AppHomeView.vue'),
meta: { requiresAuth: true },
},
{
path: '/app/businesses/:id',
name: 'app-business-detail',
component: () => import('@/views/app/AppBusinessDetailView.vue'),
meta: { requiresAuth: true },
},
{
path: '/app/bookings',
@@ -38,8 +38,11 @@ const router = createRouter({
{
path: '/app/profile',
name: 'app-profile',
component: () => import('@/views/app/AppProfileView.vue'),
meta: { requiresAuth: true },
redirect: () => {
useProfileModalStore().open();
return { name: 'app-home' };
},
},
{
path: '/app/register-business',
@@ -65,7 +68,7 @@ router.beforeEach(async (to) => {
}
if (to.meta.requiresAuth && !auth.isLoggedIn) {
return { name: 'login' };
return loginRouteWithRedirect(to.fullPath);
}
if (to.meta.requiresBusinessOwner && !auth.isBusinessOwner && !auth.isAdmin) {