Cannot read property 'changeUserInfo' of undefine?
发布于 8 年前 作者 zxiong 390 次浏览 来自 官方Issues

已经改正了好几处这样的错误了,还有,实在找不出问题,请大神帮忙看一下,不胜感激!!!

data: {

userInfo: {},

canIUse: wx.canIUse(‘button.open-type.getUserInfo’)

},

onLoad: function (){

var that = this;

wx.getSetting

({

success(res) {

if (res.authSetting[‘scope.userInfo’]){

wx.getUserInfo({

success: function (res1){

var bmobUser = res1.result||{};

if (bmobUser.avatarUrl == ‘’ || bmobUser.avatarUrl == undefined) {

var resuserInfo = res.userInfo||{};

wx.changeUserInfo(resuserInfo.avatarUrl, resuserInfo.nickName).then(res2 => { });   //错误提示处

}

错误提示如下:

VM3292:1 Setting data field “userInfo” to undefined is invalid.

Cannot read property ‘changeUserInfo’ of undefined;at api operateWXData success callback function

TypeError: Cannot read property ‘changeUserInfo’ of undefined

3 回复

wx.changeUserInfo?自己制造的?还是微信内部授权的API啊,在开发者工具上点不出来,也没有文档。

wx下有changeUserInfo这个api吗

有点迷惑

回到顶部