uni-app拒绝授权后再次授权

getLocation(){
				uni.getLocation({
				    type: 'wgs84',
				    success: function (res) {
				        console.log('当前位置的经度:' + res.longitude);
				        console.log('当前位置的纬度:' + res.latitude);
				    },
					fail(){
						uni.showModal({
							content: '检测到您没打开获取位置功能权限,是否去设置打开?',
							confirmText: "确认",
							cancelText: '取消',
							success: (res) => {
								if (res.confirm) {
									uni.openSetting({
										success: (res) => {
											uni.showToast({
												title: '授权后请重新打开此页面',
												icon: 'none',
												success:function(){
													
												}
											})
										},
										fail: (err) => {
											console.log(err)
										}
									})
								} else {
									uni.showToast({
										title: '获取地理位置授权失败',
										icon: 'none',
										success:function() {
											
										}
									})
								}
							}
						})
					}
					
				});
			},

  

原文地址:https://www.cnblogs.com/xiaohuohuai/p/14183687.html