Uniapp 判断用户是否授权并判断跳转至设置页面

export function platform() {
    return {
        isAndroid: uni.getSystemInfoSync().platform.toLowerCase() === 'android'
    }
}
                // #ifdef APP-PLUS
                let havPermision
                if (plus.os.name == "iOS") {
                    havPermision = permision.judgeIosPermission("record")
                } else if (platform().isAndroid) {
                    havPermision = await permision.requestAndroidPermission(
                        'android.permission.RECORD_AUDIO')
                    havPermision = (havPermision == 1 ? true : false)
                }
                if (!havPermision) {
                    uni.showModal({
                        title: "xxx想访问您的麦克风",
                        content: '使用麦克风',
                        success: res => {
                            if (res.confirm) permision.gotoAppPermissionSetting()
                        }
                    })
                    return
                }
                // #endif

你可能感兴趣的:(Uniapp 判断用户是否授权并判断跳转至设置页面)