Compare commits
3 Commits
dev
...
603e81853d
| Author | SHA1 | Date | |
|---|---|---|---|
| 603e81853d | |||
| 70413971e3 | |||
| 7ba1e28370 |
@@ -119,7 +119,7 @@ async function submit() {
|
|||||||
position: fixed;
|
position: fixed;
|
||||||
inset: 0;
|
inset: 0;
|
||||||
background: rgba(0, 0, 0, 0.35);
|
background: rgba(0, 0, 0, 0.35);
|
||||||
z-index: 6000;
|
z-index: 5000;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|||||||
@@ -136,7 +136,11 @@ function handleLogout() {
|
|||||||
auth.logout()
|
auth.logout()
|
||||||
ui.showToast('已退出登录')
|
ui.showToast('已退出登录')
|
||||||
emit('close')
|
emit('close')
|
||||||
window.location.reload()
|
if (router.currentRoute.value.meta.requiresAuth) {
|
||||||
|
router.push('/')
|
||||||
|
} else {
|
||||||
|
window.location.reload()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(loadNotifications)
|
onMounted(loadNotifications)
|
||||||
|
|||||||
@@ -10,11 +10,13 @@ const routes = [
|
|||||||
path: '/manage',
|
path: '/manage',
|
||||||
name: 'RecipeManager',
|
name: 'RecipeManager',
|
||||||
component: () => import('../views/RecipeManager.vue'),
|
component: () => import('../views/RecipeManager.vue'),
|
||||||
|
meta: { requiresAuth: true },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/inventory',
|
path: '/inventory',
|
||||||
name: 'Inventory',
|
name: 'Inventory',
|
||||||
component: () => import('../views/Inventory.vue'),
|
component: () => import('../views/Inventory.vue'),
|
||||||
|
meta: { requiresAuth: true },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/oils',
|
path: '/oils',
|
||||||
@@ -25,26 +27,31 @@ const routes = [
|
|||||||
path: '/projects',
|
path: '/projects',
|
||||||
name: 'Projects',
|
name: 'Projects',
|
||||||
component: () => import('../views/Projects.vue'),
|
component: () => import('../views/Projects.vue'),
|
||||||
|
meta: { requiresAuth: true },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/mydiary',
|
path: '/mydiary',
|
||||||
name: 'MyDiary',
|
name: 'MyDiary',
|
||||||
component: () => import('../views/MyDiary.vue'),
|
component: () => import('../views/MyDiary.vue'),
|
||||||
|
meta: { requiresAuth: true },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/audit',
|
path: '/audit',
|
||||||
name: 'AuditLog',
|
name: 'AuditLog',
|
||||||
component: () => import('../views/AuditLog.vue'),
|
component: () => import('../views/AuditLog.vue'),
|
||||||
|
meta: { requiresAuth: true },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/bugs',
|
path: '/bugs',
|
||||||
name: 'BugTracker',
|
name: 'BugTracker',
|
||||||
component: () => import('../views/BugTracker.vue'),
|
component: () => import('../views/BugTracker.vue'),
|
||||||
|
meta: { requiresAuth: true },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/users',
|
path: '/users',
|
||||||
name: 'UserManagement',
|
name: 'UserManagement',
|
||||||
component: () => import('../views/UserManagement.vue'),
|
component: () => import('../views/UserManagement.vue'),
|
||||||
|
meta: { requiresAuth: true },
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user