客户端

getPhoneNumber: function (e) {

let that=this;

wx.login({

success: function (res) {

if (e.detail.errMsg == 'getPhoneNumber:fail user deny') {

wx.navigateTo({

url: '../../pages/userLogin/userLogin',

});

} else {

if (e.detail.errMsg == 'getPhoneNumber:fail:cancel to confirm login') {

wx.navigateTo({

url: '../../pages/userLogin/userLogin?url='+that.data.url

});

}

else {

//console.log(res.code);

wx.request({

url: api.AESdecrypt,

data: {

'encryptedDataStr': e.detail.encryptedData,

'code': res.code,

'iv': e.detail.iv

},

method: 'post',

header: { 'content-type': 'application/x-www-form-urlencoded' },

success: function (data) {

console.log(data);

app.globalData.userInfo = data.data.data;

setTimeout(function(){

wx.navigateBack({ changed: true });//返回上一页

},500);

},

error: function () {

tip.showToast('error');

},

fail: function (err) {

tip.showToast(err);

}

})

}

}

}

});

},


服务端

try

            {

                string encryptedDataStr = System.Web.HttpContext.Current.Request["encryptedDataStr"],

                    code = System.Web.HttpContext.Current.Request["code"],

                    iv = System.Web.HttpContext.Current.Request["iv"];

                ReturnData resultMsg = new ReturnData();

                resultMsg.state = (int)StatusCodeEnum.Success;

                resultMsg.message = StatusCodeEnum.Success.GetEnumText();

                string strresult = "";

                string Appid = "Appid";

                string Secret = "Secret ";

                string grant_type = "authorization_code";

                GetU

展开全部
收起
0回答
提交回答
  • 至过去的我

    2044人对此回答表示赞同

    我是未来的你,你现在是不是在年找寻小程序答案。你不要感觉诧异,给你来信原因,就是让你不在后悔。今天去学习如何推广小程序,相信......点击查看更多>
    发布于
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
咨询热线

13312967497

扫码添加业务即可随时咨询 还可领取小程序推广攻略

业务咨询: 13312967497
扫码咨询

扫码咨询套餐

回到顶部