From c73b39b071ffeff153136d14780bf4731dccee64 Mon Sep 17 00:00:00 2001
From: chenyc <501753378@qq.com>
Date: 星期二, 26 八月 2025 13:38:31 +0800
Subject: [PATCH] gx页面初始化

---
 src/router/index.ts |   26 ++++++++++++++++----------
 1 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/src/router/index.ts b/src/router/index.ts
index 041d7f3..084aced 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -8,6 +8,7 @@
 import { Session } from '@/utils/storage'
 
 const routes: Array<RouteRecordRaw> = [
+    { path: '/HomeLoading', name: 'HomeLoading', component: () => import('views/HomeLoading/index.vue'),meta:{title:'胜透服务'}},
     { path: '/login', name: 'login', component: () => import('views/login/index.vue'),meta:{title:'登录'}},
     { path: '/', name: 'Home', component: () => import('views/home/index.vue'),meta:{title:'首页'}},
     { path: '/my', name: 'myMine', component: () => import('views/myMine/index.vue'),meta:{title:'我的'}},
@@ -17,6 +18,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 +38,22 @@
         document.title = to.meta.title
     }
     // 看看有没有toke
-    const token = Session.get('token');
-	console.log(!token)
-    if (to.path === '/login') {
-		next();
-		
-	}else{
+    const token = Session.get('token')
+    console.log(!token)
+    if (to.path === '/login'|| to.path === '/HomeLoading'){
+        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