解决方案:
1、在App.vue文件中,onShow生命周期内添加一段代码,检测是否同意使用互联网权限:
uni.onNetworkStatusChange(function(res) { console.log('onNetworkStatusChange', res); if (res.isConnected) { setTimeout(() => { uni.reLaunch({ url: '/pages/index/index' }) }, 0) } else { uni.showModal({ title: '系统提示', content: '当前设备无网络或网络较差', cancelText: '取消', confirmText: '确定', success: (res) => { if (res.confirm) { uni.reLaunch({ url: '/pages/index/index' }) } else { // #ifdef APP-PLUS plus.runtime.restart() // #endif } } }) } })
标签:uniapp,自定义,index,res,APP,后白屏,uni,权限 From: https://www.cnblogs.com/linboomboom/p/17881206.html