From e8ecfee389f4f4d4911a3ba3f9cfc20bca071602 Mon Sep 17 00:00:00 2001 From: zhaojs <349234519@qq.com> Date: 星期六, 10 六月 2023 15:19:13 +0800 Subject: [PATCH] no message --- uniapp/pages/login/login.vue | 42 +++++++++++++++++++++++++++++++++++++----- 1 files changed, 37 insertions(+), 5 deletions(-) diff --git a/uniapp/pages/login/login.vue b/uniapp/pages/login/login.vue index 50fdbff..09cb9e6 100644 --- a/uniapp/pages/login/login.vue +++ b/uniapp/pages/login/login.vue @@ -23,7 +23,6 @@ </view> </view> </view> - <view class="input-container colCen" v-else> <view class="outSidebox rowCenBet" data-type='pass' :class="selectedInput=='code'?'outSidebox-active':''"> <input @focus="changeType" @blur="cleanActive" data-type='code' type="number" v-model="code" placeholder="璇疯緭鍏ラ獙璇佺爜" @@ -105,6 +104,7 @@ if(this.isread){ if (this.ifPasslogin) { + //瀵嗙爜鐧诲綍 var param = { account: this.phone, password: this.pass, @@ -112,23 +112,27 @@ } this.$u.api.login(param).then(e => { if(e.code != 0) return that.$alert(e.msg) - that.login(e.data.userinfo); + this.targetToIndex(e); + /* that.login(e.data.userinfo); that.$alert('鐧诲綍鎴愬姛') setTimeout(function(){ uni.switchTab({ url: '../index/index' }); - },1000) + },1000) */ }).catch(function (err) { }) } else { + //楠岃瘉鐮佺櫥褰� this.$u.api.mobileLogin({ mobile: this.phone, captcha: this.code, push_cid:this.clientid }).then(e => { - if(e.code != 0) return that.$alert(e.msg) that.login(e.data.userinfo); + if(e.code != 0) return that.$alert(e.msg) + this.targetToIndex(e); + /* that.login(e.data.userinfo); utils.setCache('userInfo', e.data.userinfo) getApp().globalData.userInfo = e.data.userinfo that.$alert('鐧诲綍鎴愬姛') @@ -142,7 +146,7 @@ url: '../index/index' }) } - },1000) + },1000) */ }).catch(function (err) { }) @@ -190,6 +194,34 @@ }); } }, + + targetToIndex(e) + { + var that = this; + + that.login(e.data.userinfo); + utils.setCache('userInfo', e.data.userinfo) + getApp().globalData.userInfo = e.data.userinfo + that.$alert('鐧诲綍鎴愬姛') + setTimeout(function(){ + console.log(e.data.userinfo) + if(!e.data.userinfo.invitation_code) + { + uni.redirectTo({ + url: './setInviteCode' + }) + } + else if (e.data.userinfo.isPwd == 'N') { + uni.redirectTo({ + url: './setPass' + }) + } else { + uni.switchTab({ + url: '../index/index' + }) + } + },1000) + }, showPassfnc() { this.showPass = !this.showPass -- Gitblit v1.9.3