From 6bc0135358c021bc6d4d67e2b0a99a655e184552 Mon Sep 17 00:00:00 2001
From: chenyc <501753378@qq.com>
Date: 星期二, 26 八月 2025 11:28:15 +0800
Subject: [PATCH] 测试登出

---
 src/router/index.ts |   23 ++++++++++++++---------
 1 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/src/router/index.ts b/src/router/index.ts
index 041d7f3..23e9128 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -17,6 +17,7 @@
     { path: '/reportItem', name: 'reportItem', component: () => import('views/report/item/index.vue'),meta:{title:'报告查看'}},
     { path: '/prescriptionDrug', name: 'prescriptionDrug', component: () => import('views/prescriptionDrug/index.vue'),meta:{title:'透析医嘱'}},
     { path: '/record', name: 'record', component: () => import('views/record/index.vue'),meta:{title:'透析记录'}},
+    { path: '/xuanjiao', name: 'xuanjiao', component: () => import('views/xuanjiao/index.vue'),meta:{title:'宣教'}},
     { path: '/test', name: 'Test', component: () => import('views/test.vue')}
 ]
 
@@ -36,18 +37,22 @@
         document.title = to.meta.title
     }
     // 看看有没有toke
-    const token = Session.get('token');
-	console.log(!token)
+    const token = Session.get('token')
+    console.log(!token)
     if (to.path === '/login') {
-		next();
-		
-	}else{
+        next()
+
+    } else {
         if (!token){
-            next('/login');
-        }else{
+            next('/login')
+        } else {
             console.log('---')
-            await userInfo.setPatientApi()
-            next();
+            if (to.path === '/'){
+                await userInfo.setPatientApi()
+
+                await userInfo.setPatientApi()
+            }
+            next()
         }
     }
 })

--
Gitblit v1.8.0