feat: initialize Evergreen Health mobile app

This commit is contained in:
fuenmao
2026-09-21 15:53:02 +08:00
commit 93e9bb604d
18 changed files with 2715 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
import { createRouter, createWebHistory } from 'vue-router'
import AuthView from './views/AuthView.vue'
import OnboardingView from './views/OnboardingView.vue'
import DashboardView from './views/DashboardView.vue'
import { hasToken } from './services/auth'
const router = createRouter({
history: createWebHistory(),
routes: [
{ path: '/', redirect: '/dashboard' },
{ path: '/auth', component: AuthView, meta: { guest: true } },
{ path: '/onboarding', component: OnboardingView },
{ path: '/dashboard', component: DashboardView }
]
})
router.beforeEach((to) => {
if (!to.meta.guest && !hasToken()) return '/auth'
if (to.meta.guest && hasToken()) return '/dashboard'
})
export default router