feat: add frontend analytics tracking
This commit is contained in:
@@ -18,6 +18,12 @@ const routes: RouteRecordRaw[] = [
|
||||
name: 'Dashboard',
|
||||
component: () => import('@/views/Dashboard.vue'),
|
||||
meta: { title: '仪表盘', icon: 'DataLine' }
|
||||
},
|
||||
{
|
||||
path: 'analytics',
|
||||
name: 'AnalyticsDashboard',
|
||||
component: () => import('@/views/analytics/AnalyticsDashboard.vue'),
|
||||
meta: { title: '行为分析', icon: 'TrendCharts' }
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -120,7 +126,7 @@ const router = createRouter({
|
||||
// 路由守卫
|
||||
router.beforeEach((to, _from, next) => {
|
||||
const token = localStorage.getItem('adminToken')
|
||||
|
||||
|
||||
if (to.path === '/login') {
|
||||
if (token) {
|
||||
next('/')
|
||||
|
||||
Reference in New Issue
Block a user