这个接口可以直接获取到openid的 https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/login/auth.code2Session.html 前端只需要传code就好了
wx.getUserProfile返回的iv、encryptedData 解密获取不到 unionId,请使用 wx.login 获取 unionId