From 7c2cce763bf0959fd2cc55b16557931f4e4ffceb Mon Sep 17 00:00:00 2001
From: chenyc <501753378@qq.com>
Date: 星期二, 26 八月 2025 13:50:05 +0800
Subject: [PATCH] gx初始化
---
src/router/index.ts | 10 ++++++----
src/views/HomeLoading/index.vue | 4 ++--
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/src/router/index.ts b/src/router/index.ts
index 084aced..a195337 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -39,18 +39,20 @@
}
// 看看有没有toke
const token = Session.get('token')
- console.log(!token)
+ console.log(token,'token查看')
if (to.path === '/login'|| to.path === '/HomeLoading'){
+ console.log('进入了登录也或者是初始化页')
next()
} else {
+ console.log('不是登录页')
if (!token){
+ console.log('没有token,去登录')
next('/login')
} else {
- console.log('---')
+ console.log('有token,就随便看看')
if (to.path === '/'){
- await userInfo.setPatientApi()
-
+ console.log('去首页,设置患者信息')
await userInfo.setPatientApi()
}
next()
diff --git a/src/views/HomeLoading/index.vue b/src/views/HomeLoading/index.vue
index f934974..522e853 100644
--- a/src/views/HomeLoading/index.vue
+++ b/src/views/HomeLoading/index.vue
@@ -16,7 +16,7 @@
</div>
</template>
- <script setup>
+ <script setup lang="ts">
import { ref, onMounted } from 'vue'
import {useRoute,useRouter} from 'vue-router'
import { ajaxGet ,ajaxPost} from '@/utils/axios'
@@ -29,7 +29,7 @@
const router=useRouter()
const isLoading = ref(true)
const getUserinfo=()=>{
- ajaxPost('/patient/info/getPatientInfo','').then((re:any)=>{
+ ajaxPost('/patient/info/getPatientInfo','').then((re)=>{
console.log(re,'得到患者的信息getUserinfo')
userInfo.setPatient(re)
router.push('/')
--
Gitblit v1.8.0