34
chenyc
2022-10-21 03cd57297e17cf7785229d432609b62bc877782e
34
3个文件已修改
20 ■■■■■ 已修改文件
src/stores/userInfo.ts 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/home/index.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/login/index.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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 }
})
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" />
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('/')
        })
    }