<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合法域名里解决办法:将 (wx.qlogo.cn)添加到downloadFile合法域名

TAG标签: 小程序微信上传头像失败

http://www.xiaochengxub.com/read-103389.html