小程序如何获取code

wx.login({
success:function(res){
if(res.code){
wx.request({
url: "https://ruc.learning.stg.itknown.com/index/logi",
data:{code:res.code},
success:function(respon){
console.log(respon)
}
})
}else{
console.log('获取用户登录态失败:' + res.errMsg);
}
}
})
posted @ 2020-02-29 19:32  倔强的代码人  阅读(2695)  评论(0编辑  收藏  举报