From 2e43ad19c15c3e082fc5bced14caa3f11871c21a Mon Sep 17 00:00:00 2001 From: Lee-1203 <342694918@qq.com> Date: Fri, 22 Apr 2022 18:00:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=8B=E6=9C=BA=E7=99=BB=E5=BD=95bug?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 3 +-- config/config.js | 3 +-- pages/home/home.js | 4 +-- pages/login/login.js | 2 +- pages/login/verification/verification.js | 33 ++++++++++-------------- 5 files changed, 19 insertions(+), 26 deletions(-) diff --git a/app.js b/app.js index ad3cc09..54ec152 100644 --- a/app.js +++ b/app.js @@ -5,8 +5,7 @@ import http from './utils/requst' dd['$http'] = http; import utils from '/utils/utils' dd['utils'] = utils; -// dd['baseUrl'] = 'http://aspiration.scdxtc.cn'; -dd['baseUrl'] = 'https://ypzy.emingren.com'; +dd['baseUrl'] = 'https://sy.emingren.com'; App({ onLaunch(options) { // 第一次打开 diff --git a/config/config.js b/config/config.js index 312814e..cad2101 100644 --- a/config/config.js +++ b/config/config.js @@ -1,4 +1,3 @@ export default { - // BASE_URL: 'http://aspiration.scdxtc.cn' // api接口服务器地址 - BASE_URL: 'https://ypzy.emingren.com' // api接口服务器地址 + BASE_URL: 'https://sy.emingren.com' // api接口服务器地址 } \ No newline at end of file diff --git a/pages/home/home.js b/pages/home/home.js index 4f92425..d49b27e 100644 --- a/pages/home/home.js +++ b/pages/home/home.js @@ -8,11 +8,11 @@ Page({ console.log(userType,123) if(userType==1){ this.setData({ - url: 'http://aspevel.scdxtc.cn/#/consultant?token='+token + url: 'https://sy.h5.emingren.com/#/consultant?token='+token }) }else if(userType==0){ this.setData({ - url: 'http://aspevel.scdxtc.cn/#/index?token='+token + url: 'https://sy.h5.emingren.com/#/index?token='+token }) } diff --git a/pages/login/login.js b/pages/login/login.js index 59cfb34..ccc2887 100644 --- a/pages/login/login.js +++ b/pages/login/login.js @@ -181,7 +181,7 @@ Page({ console.log(res,'验证码数据') // 跳转页面 dd.redirectTo ({ - url: '/pages/login/verification/verification?phone='+this.data.phoneNumber+'&code='+res.data.code + url: '/pages/login/verification/verification?phone='+this.data.phoneNumber }) }) } diff --git a/pages/login/verification/verification.js b/pages/login/verification/verification.js index f80e410..b2cfade 100644 --- a/pages/login/verification/verification.js +++ b/pages/login/verification/verification.js @@ -9,15 +9,14 @@ Page({ userType: 0, placeholder:'-', number:4, - code:'', isToast: false, }, onLoad(options) { this.setData({ phoneData: options.phone, - code: options.code, }) + console.log(this.data.code,'传过来的验证码') dd.setNavigationBar({ title: '手机验证码', @@ -55,33 +54,21 @@ Page({ }); if(this.data.value.length==4){ this. handleInput(); + console.log(this.data.value,'输入的验证码') } }, handleInput() { - if(this.data.code == this.data.value){ - this.hideKeyboard(); - }else{ - this.setData({ - value: '', - toastText: '验证码错误', - isToast: true - }); - setTimeout(()=> { - this.setData({ - isToast: false - }) - }, 1000) - } + this.hideKeyboard(); }, + getCode(){ let params = { phone: this.data.phoneData, type: "login", } dd.$http.post('/api/common/send-sms-captcha',params).then(res=>{ - console.log(res,'验证码数据') if (!this.data.timer) { this.setData({ count: 60, @@ -115,7 +102,6 @@ Page({ } dd.$http.post('/api/user/login-by-Phone',params).then(res=>{ console.log(res,'登录认证数据') - if (res.code == 0) { // 缓存token dd.$toolAll.setCache('token',res.data.token); @@ -126,8 +112,17 @@ Page({ dd.redirectTo ({ url: '/pages/home/home' }) + }else{ + this.setData({ + toastText: '验证码错误', + isToast: true + }); + setTimeout(()=> { + this.setData({ + isToast: false + }) + }, 1000) } - }) }, });