34
chenyc
2022-10-21 1dfee950f260c462d070ac929ecf9377196006d9
src/views/login/index.vue
@@ -117,11 +117,11 @@
            console.log(code)
            if (code){ // 得到code换取openid
                ajaxGet('wechat/code',{code}).then((re:any)=>{
                    console.log(re)
                    console.log(re,'获取openid')
                    userInfo.setUserInfo({openid:re.openid,nickname:re.nickname,headimgurl:re.headimgurl})
                    const openid = re.openid
                    if (openid) { // 检查登录
                        ajaxPost('patient/info/wechatLogin',{openid},config).then((re:any)=>{
                    const openId = re.openid
                    if (openId) { // 检查登录
                        ajaxPost('patient/info/wechatLogin','openId='+openId,config).then((re:any)=>{
                            console.log('openid换的accesstoken=',re)
                            if (re===''){
                                Toast('请填写表单登录。。')