E企盈营销工具技术服务商 热线:4006-838-530

微信小程序拒绝授权后提示信息以及重新授权

E企盈直播平台营销卖货系统

wx.authorize({    scope: ‘scope.writePhotosAlbum’,    success() {        // 授权成功        wx.saveImageToPhotosAlbum({            filePath: that.data.tempFilePath,            success() {                app.func.setMask({                    message: ‘图片保存成功’,                    bg: ‘success’                }, that)                return            }        })    },    fail:function(){        // 授权失败        wx.showModal({            title: ‘警告’,            content: ‘您点击了拒绝授权,将无法正常保存图片,点击确定重新获取授权。’,            success: function (res) {                if (res.confirm) {                    wx.openSetting({                        success: (res) => {                            console.log(‘授权成功’)                        }                    })                }            }        })    }})   uni-app小程序授权位置信息toPositioin() {    let that = this    uni.getSetting({        success(res) {            if(res.authSetting[‘scope.userLocation’]){                // 已授权                that.getChooseLocation()            }else{                uni.authorize({                    scope: ‘scope.userLocation’,                    success(res) {                        // 授权成功                        that.getChooseLocation()                    },                    fail(err) {                        wx.showModal({                            title: ‘警告’,                            content: ‘您点击了拒绝授权,将无法正常使用发布功能,点击确定重新获取授权。’,                            success: function (res) {                                if (res.confirm) {                                    wx.openSetting({                                        success: (res) => {                                            that.toPositioin()                                        }                                    })                                }                            }                        })                    }                });            }        }    })}, 小程序

赞(0) 打赏
未经允许不得转载:E企盈小程序开发-热线:4006-838-530 » 微信小程序拒绝授权后提示信息以及重新授权
分享到: 更多 (0)
E企盈小程序直播营销卖货系统
E企盈直播平台营销卖货系统

评论 抢沙发

E企盈小程序开发

联系我们联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏