目前只有2.10.4、2.16.0及以上版本有这个api。做下兼容判断就好了。
用if(wx.getUserProfile)判断能不能用,根据文档示例代码做兼容https://developers.weixin.qq.com/miniprogram/dev/api/open-api/user-info/wx.getUserProfile.html