From 4184b50aa0f50790f21932b226da2e50d106250d Mon Sep 17 00:00:00 2001
From: chenyc <501753378@qq.com>
Date: 星期五, 21 十月 2022 15:47:38 +0800
Subject: [PATCH] 45
---
src/views/login/index.vue | 16 +++++++++++-----
1 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/src/views/login/index.vue b/src/views/login/index.vue
index 6316327..f30bd9c 100644
--- a/src/views/login/index.vue
+++ b/src/views/login/index.vue
@@ -34,6 +34,13 @@
const asyncValidator = (val:any) =>{
return val===ruleForm2.value.pass
}
+ const getUserinfo=()=>{
+ ajaxPost('/patient/info/getPatientInfo','').then((re:any)=>{
+ console.log(re,'得到患者的信息getUserinfo')
+ userInfo.setPatient(re)
+ router.push('/')
+ })
+ }
const onSubmit = (values:any) => {
console.log('submit', values)
loadingBUt.value=true
@@ -45,7 +52,7 @@
console.log('得到tokeng')
Session.set('token', re)
Toast('登录成功。。。。。')
- router.push('/')
+ getUserinfo()
}
}).finally(()=>{
loadingBUt.value=false
@@ -75,7 +82,7 @@
} else {
Session.set('token', re)
Toast('登录成功。。。。。')
- router.push('/')
+ getUserinfo()
}
})
}
@@ -123,7 +130,7 @@
if (code){ // 得到code换取openid
ajaxGet('wechat/code',{code}).then((re:any)=>{
console.log(re,'获取openid')
- userInfo.setUserInfo({openid:re.openid,nickname:re.nickname,headimgurl:re.headimgurl})
+ userInfo.setInfo({openid:re.openid,nickname:re.nickname,headimgurl:re.headimgurl})
const openId = re.openid
if (openId) { // 检查登录
ajaxPost('patient/info/wechatLogin','openId='+openId,config).then((re:any)=>{
@@ -131,10 +138,9 @@
if (re===''){
Toast('请填写表单登录。。')
} else {
- console.log()
Session.set('token', re)
Toast('登录成功。。。。。')
- router.push('/')
+ getUserinfo()
}
})
}
--
Gitblit v1.8.0