From bb6e8dab96d91b59281ea938130accdc32cab918 Mon Sep 17 00:00:00 2001
From: chenyc <501753378@qq.com>
Date: 星期四, 10 七月 2025 19:33:15 +0800
Subject: [PATCH] gx

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

diff --git a/src/router/index.ts b/src/router/index.ts
index 041d7f3..4c93bc9 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -36,18 +36,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