| | |
| | | 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 } |
| | | }) |
| | |
| | | if (userInfo.info.openid===''){ |
| | | router.push('login') |
| | | } |
| | | console.log(userInfo.patient,'患者信息') |
| | | console.log(userInfo.info,'微信账号信息') |
| | | }) |
| | | </script> |
| | | <style scoped lang="css" src="./assets/index.scss" /> |
| | |
| | | const getUserinfo=()=>{ |
| | | ajaxPost('/patient/info/getPatientInfo','').then((re:any)=>{ |
| | | console.log(re) |
| | | userInfo.setPatient(re) |
| | | router.push('/') |
| | | }) |
| | | } |