var config = require('../../config/config.js'); var app = getApp(); const Http = require("../../utils/HttpBasics"); Page({ data: { canIUse: wx.canIUse('button.open-type.getUserInfo') }, onLoad: function(options) { var that = this; }, bindGetUserInfo: function(e) { console.log(e); var iv = e.detail.iv; var encryptedData = e.detail.encryptedData; console.log(iv) console.log(encryptedData) Http.post({ url: config.api.getUserInfo, data: { encryptedData: encryptedData, iv: iv, } }) .then(function(res) { console.log(res); //返回主页 wx.switchTab({ url: '/pages/index/index', }) }, function(error) { wx.showToast({ title: '请授权个人信息', icon: "none" }) }) }, })