小程序在哪个页面获取openid小程序获取openid的案例:第一步,获取code,在app.js文件添加以下代码://app.jsApp({onLaunch:function(){wx.login({success:function(res){if(res.code){//发起网络请求wx.requ