优化代码

master
Lee-1203 2022-03-09 16:39:27 +08:00
parent afc5604e99
commit b4c26262fc
3 changed files with 3 additions and 16 deletions

View File

@ -59,7 +59,7 @@ Page({
}else if(res.data.registered == 1){
this.setData({
openPhoneTips: true,
tipsMsg: '该手机号已注册,请使用手机号登录或换绑其他手机号'
tipsMsg: '该手机号已注册,请使用手机号登录或换绑其他手机号'
})
}
})

View File

@ -169,20 +169,7 @@ Page({
}, 1000)
return false;
}
let params = {
phone: this.data.phoneNumber
}
dd.$http.post('/api/user/has-phone-user',params).then(res=>{
console.log(res,'登录认证数据')
if(res.data.registered == 0){
this.phoneLogin();
}else if(res.data.registered == 1){
this.setData({
openPhoneTips: true,
tipsMsg: '账号已存在,是否继续登录'
})
}
})
},
// 手机号登录
phoneLogin() {

View File

@ -14,7 +14,7 @@ Page({
})
}, 2000);
setTimeout(() => {
if(dd.$toolAll.getCache('userinfo')){
if(dd.$toolAll.getCache('userData')){
// 前往首页
dd.redirectTo({url:'/pages/home/home'});
}else{