Skip to content

Commit 1fe089d

Browse files
committed
update: 更新访问位置被拒绝提示语
1 parent 5feec05 commit 1fe089d

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

‎pages/API/get-location/get-location.vue‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,15 @@
8181
}
8282
// #endif
8383
// #ifndef MP-BAIDU
84-
uni.showToast({
85-
title: err.errMsg
86-
})
84+
if (err.errMsg.indexOf("auth deny") >= 0) {
85+
uni.showToast({
86+
title: "访问位置被拒绝"
87+
})
88+
} else {
89+
uni.showToast({
90+
title: err.errMsg
91+
})
92+
}
8793
// #endif
8894
}
8995
})
@@ -92,7 +98,6 @@
9298
return new Promise((resolve, reject) => {
9399
uni.getSetting({
94100
success: (res) => {
95-
console.log(res.authSetting);
96101
if (res.authSetting['scope.userLocation'] === undefined) {
97102
resolve(0);
98103
return;

0 commit comments

Comments
 (0)