From 1c0b463c243214c5a67fa9d621ff524a3714f834 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Thu, 10 Dec 2020 07:25:50 +0800 Subject: [PATCH] =?UTF-8?q?=E8=80=83=E8=AF=95=E6=9C=BA=E4=BC=9A=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 2 +- pages/bind/binduser.js | 46 ++++++++++++++++++++++++++++++++++++++++ pages/bind/binduser.wxml | 1 + pages/examtest/note.js | 8 +++++-- pages/examtest/note.wxml | 1 + project.config.json | 14 ++++++------ 6 files changed, 62 insertions(+), 10 deletions(-) diff --git a/app.js b/app.js index 45ce375..d24175a 100644 --- a/app.js +++ b/app.js @@ -98,7 +98,7 @@ App({ openid:null }, serverUrl: 'https://safeyun.ctcshe.com/', - //serverUrl: 'http://127.0.0.1:8002/', + //serverUrl: 'http://127.0.0.1:8000/', //serverUrl: 'http://10.21.28.148:8000/', //serverUrl: 'http://192.168.0.103:8000/', //serverUrl:'http://10.0.11.195:8000/', diff --git a/pages/bind/binduser.js b/pages/bind/binduser.js index dae467c..245c0dc 100644 --- a/pages/bind/binduser.js +++ b/pages/bind/binduser.js @@ -56,6 +56,46 @@ Page({ } }); }, + denglu2: function(){ + var data = this.data + data.username = 'test4' + data.password = 'q4' + wx.request({ + url: getApp().globalData.serverUrl + 'bindmp', + header: { + 'content-type': 'application/json', // + }, + method: 'POST', + data:data, + success: res => { + if (res.statusCode === 200) { + if (res.data.code == 1) { + wx.showToast({}) + getApp().globalData.userInfo = { + userid: 0, + username: '', + name: '', + isaqy: 0, + mpopenid: '', + companyid: '', + perms: [], + openid:null + } //重置globaldata和session + getApp().mplogin() + wx.switchTab({ + url: '/pages/main/main', + }) + }else{ + wx.showModal({ + content: '账户或密码不正确!', + showCancel: false, + confirmText: "确定" + }) + } + } + } + }); + }, getUserbasic:function(){ var that = this wx.request({ @@ -86,6 +126,12 @@ Page({ }) this.denglu() }, + onGetInfo2:function(e){ + this.setData({ + userInfo:e.detail.userInfo + }) + this.denglu2() + }, /** * 生命周期函数--监听页面加载 */ diff --git a/pages/bind/binduser.wxml b/pages/bind/binduser.wxml index fb1decb..c910680 100644 --- a/pages/bind/binduser.wxml +++ b/pages/bind/binduser.wxml @@ -30,6 +30,7 @@ 账号错误或忘记密码? +