<button open-type="getUserInfo" lang="zh_CN" @getuserinfo="onGotUserInfo">同意</button>
onGotUserInfo(e) {this.nickName=e.target.userInfo.nickName;wx.getImageInfo({src: e.target.userInfo.avatarUrl,success: function (res) {wx.setStorageSync('myAvatarUrl',res.path);},fail(err) {console.log(err,'失败');}})},```wx.getImageInfo获取头像失败,原因:微信头像的域名不在downloadFile合法域名里解决办法:将 ()添加到downloadFile合法域名