From 03cd57297e17cf7785229d432609b62bc877782e Mon Sep 17 00:00:00 2001
From: chenyc <501753378@qq.com>
Date: 星期五, 21 十月 2022 15:01:05 +0800
Subject: [PATCH] 34

---
 src/stores/userInfo.ts    |   17 +++++------------
 src/views/home/index.vue  |    2 ++
 src/views/login/index.vue |    1 +
 3 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/src/stores/userInfo.ts b/src/stores/userInfo.ts
index 1d8ac01..56b0c4f 100644
--- a/src/stores/userInfo.ts
+++ b/src/stores/userInfo.ts
@@ -8,22 +8,15 @@
         headimgurl:'',
         nickname:'',
     })
-    // const patient=ref({
-    //     patientName:'',
-    //     patientTelNo:'',
-    //     id:0,
-    //     code:'',
-    // })
+    const patient=ref({})
     function setInfo(userInfo:{openid:string, headimgurl:string,nickname:string}) {
         info.value.openid=userInfo.openid
         info.value.headimgurl=userInfo.headimgurl
         info.value.nickname=userInfo.nickname
     }
-    // function setUser(userInfo:{openid:string, headimgurl:string,nickname:string}) {
-    //     info.value.openid=userInfo.openid
-    //     info.value.headimgurl=userInfo.headimgurl
-    //     info.value.nickname=userInfo.nickname
-    // }
+    function setPatient(patient:object) {
+        patient.value=patient
+    }
 
-    return { info, setInfo }
+    return { info,patient,setPatient, setInfo }
 })
diff --git a/src/views/home/index.vue b/src/views/home/index.vue
index 0f484ac..ebc15d4 100644
--- a/src/views/home/index.vue
+++ b/src/views/home/index.vue
@@ -150,6 +150,8 @@
         if (userInfo.info.openid===''){
             router.push('login')
         }
+        console.log(userInfo.patient,'患者信息')
+        console.log(userInfo.info,'微信账号信息')
     })
   </script>
   <style scoped lang="css" src="./assets/index.scss" />
\ No newline at end of file
diff --git a/src/views/login/index.vue b/src/views/login/index.vue
index bd98772..d63d4d5 100644
--- a/src/views/login/index.vue
+++ b/src/views/login/index.vue
@@ -37,6 +37,7 @@
     const getUserinfo=()=>{
         ajaxPost('/patient/info/getPatientInfo','').then((re:any)=>{
             console.log(re)
+            userInfo.setPatient(re)
             router.push('/')
         })
     }

--
Gitblit v1.8.0