From 8d5b216c963e9c2f0bf17a8d8ad7789c1a209258 Mon Sep 17 00:00:00 2001
From: zhizhijie <zhizhijie@users.noreply.gitee.com>
Date: 星期日, 27 九月 2026 17:37:32 +0800
Subject: [PATCH] fix(汇总表母版): 轨道轮渡 R2/R11 表头按人工定稿改为『同比』(与累计同比体例一致);仅改母版,重新生成验证仅此 2 格变化

---
 traffic-audit-web/src/router/index.js |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/traffic-audit-web/src/router/index.js b/traffic-audit-web/src/router/index.js
index 2540f38..6316dc6 100644
--- a/traffic-audit-web/src/router/index.js
+++ b/traffic-audit-web/src/router/index.js
@@ -3,7 +3,7 @@
 
 Vue.use(Router)
 
-export default new Router({
+const router = new Router({
   routes: [
     { path: '/', redirect: '/login' },
     { path: '/login', name: 'Login', component: () => import('@/views/Login.vue') },
@@ -17,3 +17,14 @@
     { path: '/users', name: 'UserManage', component: () => import('@/views/UserManage.vue') }
   ]
 })
+
+router.beforeEach((to, from, next) => {
+  const token = sessionStorage.getItem('token')
+  if (to.path === '/login') {
+    next(token ? '/dashboard' : undefined)
+  } else {
+    next(token ? undefined : '/login')
+  }
+})
+
+export default router

--
Gitblit v1.9.1