开发版、体验版都能正常授权 就正式版不行
savePosterTap() {
let that = this
// 向用户发起授权请求
uni.authorize({
scope: 'scope.writePhotosAlbum',
success: (e) => {
console.log(e)
// 已授权
that.downLoadImg()
},
fail: () => {
// 拒绝授权,获取当前设置
uni.getSetting({
success: (result) => {
console.log(result)
if (!result.authSetting['scope.writePhotosAlbum']) {
that.isAuth()
}
}
})
}
})
},
downLoadImg() {
let that = this
uni.showLoading({
title: '加载中'
})
uni.downloadFile({
url: that.promote_img,
success: ({ tempFilePath, statusCode }) => {
uni.hideLoading()
if (statusCode === 200) {
uni.saveImageToPhotosAlbum({
filePath: tempFilePath,
success(e) {
console.log(e)
uni.$u.toast('保存成功')
that.isshow = false
},
fail(e) {
console.log(e)
uni.$u.toast('保存失败')
that.isshow = false
}
})
}
},
fail: (error) => {
console.log(error)
uni.$u.toast('失败啦')
}
})
},
/*
* 引导用户开启权限
*/
isAuth() {
uni.showModal({
content: '检查到您没打开保存到相册的权限,是否现在去打开?',
success: (res) => {
if (res.confirm) {
uni.openSetting({
success: (result) => {
console.log(result.authSetting)
},
fail: (e) => {
console.log(e)
}
})
}
}
})
}
你好,请提供具体appid进一步核实原因。
隐私设置也加了
上个版本都正常,新版本上传设置里面直接看不到添加到相册这一项了