Browse Source

密码可以为空

master
chenxuhui 6 years ago
parent
commit
719343707e
2 changed files with 26 additions and 7 deletions
  1. +23
    -4
      pages/login/login.js
  2. +3
    -3
      utils/net.js

+ 23
- 4
pages/login/login.js View File

@ -18,6 +18,7 @@ function GetBindCustomer(that) {
app.globalData.phoneNum = res.result.WeixinUser_Phone;
// 获取cookie值
WeixinLogin(function (res) {
setCurrentCustomerID();
wx.switchTab({
url: '/pages/homePage/homePage',
})
@ -37,7 +38,7 @@ function setCurrentCustomerID (){
// 获取cookie值 参数1、appID 2、openID
function WeixinLogin(successtion) {
let method = getCookie;
let method = '/MainSystem/B3MiniProgramRpc/Rpcs/CommonRpc/WeixinLogin';
let params = [app.globalData.appID, app.globalData.openID];
network.transfer_request(method, params, function (res) {
app.globalData.cookie = res.result;
@ -62,9 +63,10 @@ function XuBindByPhone(that) {
"HeadImgUrl": userInfos.avatarUrl,
"UnionId": "",
}];
network.newRequestLoading(method2, params2, function (res) {
network.transfer_request(method2, params2, function (res) {
if (res.result != null) {
WeixinLogin(function () {
setCurrentCustomerID();
wx.switchTab({
url: '/pages/homePage/homePage',
})
@ -78,7 +80,6 @@ Page({
code: "",
userName: "",
psw: "",
index: 0,
phoneNum: "",
},
@ -123,6 +124,24 @@ Page({
var that = this;
if (e.detail.userInfo != null) {
app.globalData.userInfo = e.detail.userInfo
if (this.data.code == "") {
wx.showToast({
title: '请输入企业编码',
})
return false;
}
if (this.data.userName == "") {
wx.showToast({
title: '请输入用户名',
})
return false;
}
// if (this.data.psw == "") {
// wx.showToast({
// title: '请输入密码',
// })
// return false;
// }
if (this.data.phoneNum == "") {
wx.showToast({
title: '请输入手机号码',
@ -149,7 +168,7 @@ Page({
"HeadImgUrl": userInfos.avatarUrl,
"UnionId": ""
}];
network.transfer_request(method, params, function (res) {
network.requestLoading(method, params, function (res) {
if (res.result != null) {
app.globalData.globalCustomerID = res.result;
XuBindByPhone(that);


+ 3
- 3
utils/net.js View File

@ -19,7 +19,7 @@ function requestLoading(method, params, successaction) {
'method': method,
'params': params
};
console.log(data);
wx.request({
url: app.globalData.baseUrl,
data: data,
@ -88,7 +88,7 @@ function transfer_request(method, params, successaction) {
"Method": method,
"Data": params,
};
console.log(newData);
var baseUrl = app.globalData.tranferBaseUrl;
wx.request({
url: baseUrl,
@ -99,7 +99,7 @@ function transfer_request(method, params, successaction) {
},
method: 'POST',
success: function (res) {
// console.log(res)
if (res.data.error != null) {
if (res.data.error.code == 401) {
wx.request({


Loading…
Cancel
Save