createUserInfoButton 拒绝授权的情况

发布于 7 年前作者 xiuying908208 次浏览最后编辑 7 年前来自 ask
var button = wx.createUserInfoButton({
    type: 'text',
    text: '获取用户信息',
    style: {
        left: 10,
        top: 76,
        width: 200,
        height: 40,
        lineHeight: 40,
        backgroundColor: '#ff0000',
        color: '#ffffff',
        textAlign: 'center',
        fontSize: 16,
        borderRadius: 4
    }
})
button.onTap((res) = > {    console.log(res)

})

按照例子的代码,在弹出的授权框选择拒绝,会报以下错误:

Unhandled promise rejection

Object { "errMsg": "getUserInfo:...

errMsg: "getUserInfo:fail auth deny"

该怎么处理拒绝的情况

0 回复
暂无回复