diff --git a/pages/formid/formid.js b/pages/formid/formid.js index e8247c2..3c3523a 100644 --- a/pages/formid/formid.js +++ b/pages/formid/formid.js @@ -63,49 +63,52 @@ Page({ }) }, bindGetUserInfo: function (e) { - if (e.detail.userInfo) { - // let wxHeadImg = e.detail.userInfo.avatarUrl - // let wxNickName = e.detail.userInfo.nickName - console.log(e) - let that = this - wx.login({ - success: function (response) { - let code = response.code; - wx.getUserInfo({ - success: function (res) { - console.log(res.encryptedData) - console.log(res.iv) - let encryptedData = res.encryptedData - let iv = res.iv - api.updateWxInfo(code, encryptedData, iv).then(function (res) { - // 跳转到首页 - console.log('跳转到首页') - wx.setStorageSync('isFirst', 'noFirst') - wx.reLaunch({ - url: '/pages/index/index' - }) - }) - } - }) - } - }) + // if (e.detail.userInfo) { + // // let wxHeadImg = e.detail.userInfo.avatarUrl + // // let wxNickName = e.detail.userInfo.nickName + // console.log(e) + // let that = this + // wx.login({ + // success: function (response) { + // let code = response.code; + // wx.getUserInfo({ + // success: function (res) { + // console.log(res.encryptedData) + // console.log(res.iv) + // let encryptedData = res.encryptedData + // let iv = res.iv + // api.updateWxInfo(code, encryptedData, iv).then(function (res) { + // // 跳转到首页 + // console.log('跳转到首页') + // wx.setStorageSync('isFirst', 'noFirst') + // wx.reLaunch({ + // url: '/pages/index/index' + // }) + // }) + // } + // }) + // } + // }) - } else { - console.log('拒绝授权') - wx.redirectTo({ - url: '/pages/index/index' - }) - // wx.showModal({ - // title: '提示', - // content: '您点击了拒绝授权,将无法进入小程序,请授权之后再进入!', - // showCancel: false, - // confirmText: '返回授权', - // success: function (res) { - // if (res.confirm) { - // console.log('用户点击了“返回授权”') - // } - // } - // }) - } + // } else { + // console.log('拒绝授权') + // wx.redirectTo({ + // url: '/pages/index/index' + // }) + // // wx.showModal({ + // // title: '提示', + // // content: '您点击了拒绝授权,将无法进入小程序,请授权之后再进入!', + // // showCancel: false, + // // confirmText: '返回授权', + // // success: function (res) { + // // if (res.confirm) { + // // console.log('用户点击了“返回授权”') + // // } + // // } + // // }) + // } + wx.reLaunch({ + url: '/pages/index/index' + }) } }) diff --git a/pages/formid/formid.wxml b/pages/formid/formid.wxml index 397dfcb..93f05f7 100644 --- a/pages/formid/formid.wxml +++ b/pages/formid/formid.wxml @@ -11,6 +11,7 @@   - + + \ No newline at end of file