收藏
回答

we.getUserInfo

wx.login({

    success: function (e) {

        console.log(e)

        wx.getUserInfo({

            success: function (res) {

            var simpleUser = res.userInfo;

                console.log(simpleUser.nickName);

            },

            fail:function(res){

                console.log(res)

            }

        });

    },

    fail:function(e){

    console.log(e)

    }

});

输出为:{errMsg: "login:ok", code: "071C7ucn1AvRqk0rFKdn1l2xcn1C7uct"}和{errMsg: "getUserInfo:fail scope unauthorized"}


最后一次编辑于  2018-05-11  (未经腾讯允许,不得转载)
邀请回答
复制链接收藏关注问题回答

2 个回答

  • 尹衍伟
    尹衍伟
    2018-05-11

    关于getUserInfo接口,请看最新官方公告。https://developers.weixin.qq.com/blogdetail?action=get_post_info&lang=zh_CN&token=1472340389&docid=000aee01f98fc0cbd4b6ce43b56c01

    2018-05-11
    赞同
    回复
  • 千千千千千~
    千千千千千~
    2018-05-11

    刚刚调整?



    2018-05-11
    赞同
    回复