feat: tenant-scoped routing and portal navigation
This commit is contained in:
@@ -8,7 +8,7 @@ const router = createRouter({
|
||||
history: createWebHistory(import.meta.env.BASE_URL),
|
||||
routes: [
|
||||
{
|
||||
path: '/',
|
||||
path: '/t/:tenantCode',
|
||||
component: LayoutMain,
|
||||
children: [
|
||||
{
|
||||
@@ -37,19 +37,19 @@ const router = createRouter({
|
||||
component: () => import('../views/TopicsView.vue') // Placeholder
|
||||
},
|
||||
{
|
||||
path: 'creator/apply',
|
||||
name: 'creator-apply',
|
||||
component: () => import('../views/creator/ApplyView.vue')
|
||||
path: 'creator/apply',
|
||||
name: 'creator-apply',
|
||||
component: () => import('../views/creator/ApplyView.vue')
|
||||
},
|
||||
{
|
||||
path: 'creator/contents/new',
|
||||
name: 'creator-content-new',
|
||||
component: () => import('../views/creator/ContentsEditView.vue')
|
||||
path: 'creator/contents/new',
|
||||
name: 'creator-content-new',
|
||||
component: () => import('../views/creator/ContentsEditView.vue')
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/auth',
|
||||
path: '/t/:tenantCode/auth',
|
||||
component: LayoutAuth,
|
||||
children: [
|
||||
{
|
||||
@@ -60,129 +60,129 @@ const router = createRouter({
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/me',
|
||||
component: LayoutUser,
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
name: 'user-dashboard',
|
||||
component: () => import('../views/user/DashboardView.vue')
|
||||
},
|
||||
{
|
||||
path: 'orders',
|
||||
name: 'user-orders',
|
||||
component: () => import('../views/user/OrdersView.vue')
|
||||
},
|
||||
{
|
||||
path: 'orders/:id',
|
||||
name: 'user-order-detail',
|
||||
component: () => import('../views/order/DetailView.vue')
|
||||
},
|
||||
{
|
||||
path: 'wallet',
|
||||
name: 'user-wallet',
|
||||
component: () => import('../views/user/WalletView.vue')
|
||||
},
|
||||
{
|
||||
path: 'coupons',
|
||||
name: 'user-coupons',
|
||||
component: () => import('../views/user/CouponsView.vue')
|
||||
},
|
||||
{
|
||||
path: 'library',
|
||||
name: 'user-library',
|
||||
component: () => import('../views/user/LibraryView.vue')
|
||||
},
|
||||
{
|
||||
path: 'favorites',
|
||||
name: 'user-favorites',
|
||||
component: () => import('../views/user/FavoritesView.vue')
|
||||
},
|
||||
{
|
||||
path: 'likes',
|
||||
name: 'user-likes',
|
||||
component: () => import('../views/user/LikesView.vue')
|
||||
},
|
||||
{
|
||||
path: 'notifications',
|
||||
name: 'user-notifications',
|
||||
component: () => import('../views/user/NotificationsView.vue')
|
||||
},
|
||||
{
|
||||
path: 'profile',
|
||||
name: 'user-profile',
|
||||
component: () => import('../views/user/ProfileView.vue')
|
||||
},
|
||||
{
|
||||
path: 'security',
|
||||
name: 'user-security',
|
||||
component: () => import('../views/user/SecurityView.vue')
|
||||
}
|
||||
]
|
||||
path: '/t/:tenantCode/me',
|
||||
component: LayoutUser,
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
name: 'user-dashboard',
|
||||
component: () => import('../views/user/DashboardView.vue')
|
||||
},
|
||||
{
|
||||
path: 'orders',
|
||||
name: 'user-orders',
|
||||
component: () => import('../views/user/OrdersView.vue')
|
||||
},
|
||||
{
|
||||
path: 'orders/:id',
|
||||
name: 'user-order-detail',
|
||||
component: () => import('../views/order/DetailView.vue')
|
||||
},
|
||||
{
|
||||
path: 'wallet',
|
||||
name: 'user-wallet',
|
||||
component: () => import('../views/user/WalletView.vue')
|
||||
},
|
||||
{
|
||||
path: 'coupons',
|
||||
name: 'user-coupons',
|
||||
component: () => import('../views/user/CouponsView.vue')
|
||||
},
|
||||
{
|
||||
path: 'library',
|
||||
name: 'user-library',
|
||||
component: () => import('../views/user/LibraryView.vue')
|
||||
},
|
||||
{
|
||||
path: 'favorites',
|
||||
name: 'user-favorites',
|
||||
component: () => import('../views/user/FavoritesView.vue')
|
||||
},
|
||||
{
|
||||
path: 'likes',
|
||||
name: 'user-likes',
|
||||
component: () => import('../views/user/LikesView.vue')
|
||||
},
|
||||
{
|
||||
path: 'notifications',
|
||||
name: 'user-notifications',
|
||||
component: () => import('../views/user/NotificationsView.vue')
|
||||
},
|
||||
{
|
||||
path: 'profile',
|
||||
name: 'user-profile',
|
||||
component: () => import('../views/user/ProfileView.vue')
|
||||
},
|
||||
{
|
||||
path: 'security',
|
||||
name: 'user-security',
|
||||
component: () => import('../views/user/SecurityView.vue')
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/creator',
|
||||
component: LayoutCreator,
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
name: 'creator-dashboard',
|
||||
component: () => import('../views/creator/DashboardView.vue')
|
||||
},
|
||||
{
|
||||
path: 'contents',
|
||||
name: 'creator-contents',
|
||||
component: () => import('../views/creator/ContentsView.vue')
|
||||
},
|
||||
{
|
||||
path: 'contents/new',
|
||||
name: 'creator-content-new',
|
||||
component: () => import('../views/creator/ContentsEditView.vue')
|
||||
},
|
||||
{
|
||||
path: 'contents/:id',
|
||||
name: 'creator-content-edit',
|
||||
component: () => import('../views/creator/ContentsEditView.vue')
|
||||
},
|
||||
{
|
||||
path: 'orders',
|
||||
name: 'creator-orders',
|
||||
component: () => import('../views/creator/OrdersView.vue')
|
||||
},
|
||||
{
|
||||
path: 'settings',
|
||||
name: 'creator-settings',
|
||||
component: () => import('../views/creator/SettingsView.vue')
|
||||
}
|
||||
]
|
||||
path: '/t/:tenantCode/creator',
|
||||
component: LayoutCreator,
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
name: 'creator-dashboard',
|
||||
component: () => import('../views/creator/DashboardView.vue')
|
||||
},
|
||||
{
|
||||
path: 'contents',
|
||||
name: 'creator-contents',
|
||||
component: () => import('../views/creator/ContentsView.vue')
|
||||
},
|
||||
{
|
||||
path: 'contents/new',
|
||||
name: 'creator-content-new',
|
||||
component: () => import('../views/creator/ContentsEditView.vue')
|
||||
},
|
||||
{
|
||||
path: 'contents/:id',
|
||||
name: 'creator-content-edit',
|
||||
component: () => import('../views/creator/ContentsEditView.vue')
|
||||
},
|
||||
{
|
||||
path: 'orders',
|
||||
name: 'creator-orders',
|
||||
component: () => import('../views/creator/OrdersView.vue')
|
||||
},
|
||||
{
|
||||
path: 'settings',
|
||||
name: 'creator-settings',
|
||||
component: () => import('../views/creator/SettingsView.vue')
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/checkout',
|
||||
component: LayoutMain,
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
name: 'checkout',
|
||||
component: () => import('../views/order/CheckoutView.vue')
|
||||
}
|
||||
]
|
||||
path: '/t/:tenantCode/checkout',
|
||||
component: LayoutMain,
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
name: 'checkout',
|
||||
component: () => import('../views/order/CheckoutView.vue')
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/payment/:id',
|
||||
component: LayoutMain,
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
name: 'payment',
|
||||
component: () => import('../views/order/PaymentView.vue')
|
||||
}
|
||||
]
|
||||
path: '/t/:tenantCode/payment/:id',
|
||||
component: LayoutMain,
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
name: 'payment',
|
||||
component: () => import('../views/order/PaymentView.vue')
|
||||
}
|
||||
]
|
||||
},
|
||||
// Fallback
|
||||
{
|
||||
path: '/:pathMatch(.*)*',
|
||||
name: 'not-found',
|
||||
component: () => import('../views/misc/NotFoundView.vue')
|
||||
{
|
||||
path: '/:pathMatch(.*)*',
|
||||
name: 'not-found',
|
||||
component: () => import('../views/misc/NotFoundView.vue')
|
||||
}
|
||||
],
|
||||
scrollBehavior(to, from, savedPosition) {
|
||||
|
||||
Reference in New Issue
Block a user