关于用户授权的问题
发布于 6 年前 作者 qiang01 2654 次浏览 来自 问答

我查了社区的所有关于授权的问题,都出现同一个问题,在开发工具上getSetting和openSetting都是可以用的,但是在真机上毫无反应,希望微信团队能尽快修复(如果这个问题是我代码问题,也请指出到底应该怎么用?

onLaunch: function () {
        console.log('App Launch')
        let that = this
        if(wx.getSetting) {
            console.log('开始获取用户的当前设置')
            wx.getSetting({
                complete: (res) => {
                    console.log(res)
                },
                success: (res) => {
                    if(!res.authSetting['scope.userInfo']) {
                        wx.openSetting({
                            success: (result) => {
                                console.log(result)
                            }
                        })
                    } else {
                        that.getUserInfo()
                    }
                }
            })
        } else {
            wx.showModal({
                title: '提示',
                content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
            })
        }
    },
1 回复

你好,反馈已收到,我们会尽快处理。

回到顶部