初始化足球投注平台 MVP Monorepo

包含 NestJS 后端、三端前端、Prisma 数据模型、结算引擎测试与 PRD 文档。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-02 14:35:48 +08:00
commit 14e49374ac
118 changed files with 15944 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
import { createRouter, createWebHistory } from 'vue-router';
import { useAuthStore } from './stores/auth';
const router = createRouter({
history: createWebHistory(),
routes: [
{ path: '/login', component: () => import('./views/LoginView.vue') },
{
path: '/',
component: () => import('./layouts/MainLayout.vue'),
meta: { requiresAuth: true },
children: [
{ path: '', component: () => import('./views/HomeView.vue') },
{ path: 'football', component: () => import('./views/FootballView.vue') },
{ path: 'match/:id', component: () => import('./views/MatchDetailView.vue') },
{ path: 'bets', component: () => import('./views/MyBetsView.vue') },
{ path: 'profile', component: () => import('./views/ProfileView.vue') },
],
},
],
});
router.beforeEach((to) => {
const auth = useAuthStore();
if (to.meta.requiresAuth && !auth.token) return '/login';
if (to.path === '/login' && auth.token) return '/';
});
export default router;