手机登录bug修改
							parent
							
								
									e57c1c9bd8
								
							
						
					
					
						commit
						2e43ad19c1
					
				
							
								
								
									
										3
									
								
								app.js
								
								
								
								
							
							
						
						
									
										3
									
								
								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) {
 | 
			
		||||
    // 第一次打开
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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接口服务器地址
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
      })
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
      })
 | 
			
		||||
    })
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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)
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
 | 
			
		||||
  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)
 | 
			
		||||
      }
 | 
			
		||||
      
 | 
			
		||||
    })
 | 
			
		||||
  },
 | 
			
		||||
});
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue