From 251b58150984896c86cd306cd3a4db77f14b7e1a Mon Sep 17 00:00:00 2001
From: chenyc <501753378@qq.com>
Date: 星期五, 21 十月 2022 12:32:09 +0800
Subject: [PATCH] 45
---
src/views/login/index.vue | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/src/views/login/index.vue b/src/views/login/index.vue
index 59bd95b..6316327 100644
--- a/src/views/login/index.vue
+++ b/src/views/login/index.vue
@@ -73,7 +73,9 @@
if (re===false){
Toast('登录失败,请重新登录')
} else {
- console.log(re)
+ Session.set('token', re)
+ Toast('登录成功。。。。。')
+ router.push('/')
}
})
}
@@ -82,8 +84,11 @@
Toast('手机号码不能为空')
return
}
- ajaxPost('patient/info/sendValidCode','phoneNo='+ruleForm3.value.userPhone,config).then(re=>{
+ ajaxPost('patient/info/sendValidCode','phoneNo='+ruleForm3.value.userPhone,config).then((re:any)=>{
console.log(re)
+ if (re.code===200){
+ return
+ }
const timer= setInterval(() => {
if (seconds.value > 0) {
seconds.value--
@@ -117,11 +122,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)=>{
+ ajaxPost('patient/info/wechatLogin','openId='+openId,config).then((re:any)=>{
console.log('openid换的accesstoken=',re)
if (re===''){
Toast('请填写表单登录。。')
--
Gitblit v1.8.0