收藏
回答

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"}


回答关注问题邀请回答
收藏

4 个回答

登录 后发表内容