瀏覽代碼

登录bug修复

rongxin_dev
张泽亮 1 年之前
父節點
當前提交
f1f27510e6
共有 1 個檔案被更改,包括 16 行新增14 行删除
  1. +16
    -14
      pages/user/login/login.js

+ 16
- 14
pages/user/login/login.js 查看文件

@@ -31,7 +31,7 @@ Page({
UTIL.getCOdeFromWX({
complate: (code) => {
//获取openId
console.log('aaaa');
//console.log('aaaa');
that.getOpenIdFromFW(code);
}
});
@@ -52,10 +52,10 @@ Page({
let sendData = {
code: code
}
console.log(wx.getStorageSync('dressCode')+API.URL_GET_OPENID);
//console.log(wx.getStorageSync('dressCode')+API.URL_GET_OPENID);
UTIL.httpRequestNoneDetal(API.URL_GET_OPENID, sendData, "POST", {
success: (res) => {
console.log(res);
//console.log(res);
if (res.code == API.SUCCESS_CODE) {
// UTIL.showToastNoneIcon("openId:" + res._data.openid);
if(res.token){
@@ -64,7 +64,9 @@ Page({
wx.setStorageSync('sessionKey', res.data.sessionKey);
getApp().globalData.userInfo.token = res.token;
}else{
this.setData({showPhoneBtn:true})
wx.setstorageSync('openId', res .data.openId);
wx.setStorageSync( 'sessionKey', res .data.sessionkey);
this.setData({showPhoneBtn:true})
}
} else {
//未获取到openId
@@ -89,7 +91,7 @@ Page({
let automatic = STORAGE.getToken();
let getOpenId = STORAGE.getOpenId();
if(automatic == '' && getOpenId ==''){
console.log(1);
//console.log(1);
UTIL.getCOdeFromWX({
complate: (code) => {
let sendData = {
@@ -97,7 +99,7 @@ Page({
}
UTIL.httpRequestNoneDetal(API.URL_GET_OPENID, sendData, "POST", {
success: (res) => {
console.log(res);
//console.log(res);
if (res.code == API.SUCCESS_CODE) {
wx.reLaunch({
url: '/pages/index/index',
@@ -151,7 +153,7 @@ Page({
APP.showToast("请阅读并同意【服务须知】!");
return;
}
console.log(detail)
//console.log(detail)
let sendData = {
sessionKey:STORAGE.getSessionKey(),
iv:detail.iv,
@@ -159,7 +161,7 @@ Page({
}
UTIL.httpRequestNoneDetal(API.URL_POST_DECRYPTEDWXDATA, sendData, "POST", {
success: (res) => {
console.log(res)
//console.log(res)
if (res.code == API.SUCCESS_CODE) {
let phoneNumber = res.data.phoneNumber;
//微信手机号码绑定
@@ -171,7 +173,7 @@ Page({
}
},
fail: (res) => {
console.log("fail");
//console.log("fail");
UTIL.showToastNoneIcon(API.MSG_FAIL_HTTP)
}
})
@@ -185,7 +187,7 @@ Page({
// // // UTIL.showToastNoneIcon("数据共:" + res._data.length + "条");
// // } else {
// // //待删
// // UTIL.showToastNoneIcon(res.msg)
// // }
// },
@@ -200,7 +202,7 @@ Page({
openId:STORAGE.getOpenId(),
phonenumber:phone
}
console.log(STORAGE.getOpenId());
//console.log(STORAGE.getOpenId());
UTIL.httpRequestNoneDetal(API.URL_POST_USERBAND, sendData,"POST",{
success: (res) => {
if (res.code == API.SUCCESS_CODE) {
@@ -217,7 +219,7 @@ Page({
UTIL.showToastNoneIcon(API.MSG_FAIL_HTTP)
}
});
//
//
},
//打开协议窗口
openDialog(){
@@ -233,5 +235,5 @@ Page({
url: '/pages/phoneLogin',
})
}
})
})

Loading…
取消
儲存