feature: RBAC + Clinical Audit Logging

This commit is contained in:
voltsrage
2026-06-21 15:46:55 +08:00
parent a43db52813
commit 5af6ab490e
83 changed files with 4281 additions and 70 deletions
+16 -1
View File
@@ -1,10 +1,17 @@
import { createRouter, createWebHistory } from 'vue-router'
import { useAuthStore } from '@/stores/auth'
const routes = [
{
path: '/',
redirect: '/ward',
},
{
path: '/login',
name: 'Login',
component: () => import('@/views/LoginView.vue'),
meta: { title: 'Sign In', public: true },
},
{
path: '/ward',
name: 'WardDashboard',
@@ -38,6 +45,14 @@ const router = createRouter({
router.beforeEach((to) => {
document.title = `${to.meta.title ?? 'VigilCare'} — VigilCare`
const auth = useAuthStore()
if (!to.meta.public && !auth.isAuthenticated) {
return { path: '/login', query: { redirect: to.fullPath } }
}
if (to.path === '/login' && auth.isAuthenticated) {
return { path: '/ward' }
}
})
export default router
export default router