wx.login({ success: function(res) { //加签 var addsignData_100001 = { txn_type: '100001', js_code: res.code, user_channel:'000' } var outDate_100001 = addSign.jiaqian(addsignData_100001); wx.showLoading({ title: '', mask: true }) wx.request({ url: app.globalData.service_url, data: outDate_100001, method: 'POST', success: function(res) { //验签 var verifySignData = res.data; var inData = verifySign.yanqian(verifySignData); wx.setStorageSync('openid', inData.openid) if (inData.unionid) { wx.setStorageSync('unionid', inData.unionid) } else { wx.setStorageSync('unionid', '') } wx.setStorageSync('userid', inData.userid) wx.setStorageSync('id_no', inData.id_no) wx.setStorageSync('phone', inData.phone) console.log(res) that.setData({ register: inData.is_register }) if (inData.is_register == '0' && inData.phone==''){ return }else{ app.globalData.register1 == '02' that.setData({ register1: '02' }) } //加签 var addsignData_100006 = { txn_type: '100006', openid: res.data.openid, user_channel: '000', unionid: res.data.unionid, // cpStatus: '02', userid: res.data.userid, id_no: res.data.id_no, phone: res.data.phone } var outDate_100006 = addSign.jiaqian(addsignData_100006); wx.request({ url: app.globalData.service_url, method: 'POST', data: outDate_100006, success: function(res) { wx.hideLoading() console.log(res) //验签 var verifySignData = res.data; var inData = verifySign.yanqian(verifySignData); let list = inData.coupon if (inData == "") { list = [] } for (let i = 0; i < list.length; i++) { list[i].checked = false list[i].cpStartDate = format.formatTime(list[i].cpStartDate) list[i].cpEndDate = format.formatTime(list[i].cpEndDate) list[i].showstatus = '01' list[i].txtStyle = '' } that.setData({ list: list, deleteList: list }) } }) }, fail: function() { wx.hideLoading() }, complete: function() { wx.hideLoading() } }) } }) },
auth.code2Session 接口问题? 响应40029现象:测试环境真机测试没有任何问题, 获取code后换取openid。 生产环境获取code后,后台请求code2Session接口(且后台只收到一次前台的请求),发现code与前端vconsole日志显示的code不一致,导致code2Session接口返回 40029 排查两天没发现问题所在,求助各位大佬。 代码: [图片]
2020-05-28