更新
This commit is contained in:
@@ -41,6 +41,22 @@ const instance = defineStore('user', {
|
||||
let { lat: latitude, lng: longitude } = result.position
|
||||
this.position = { latitude, longitude }
|
||||
} else {
|
||||
switch (result.status) {
|
||||
case 1:
|
||||
Notify({
|
||||
message: '用户拒绝对获取地理位置的请求。',
|
||||
type: 'danger',
|
||||
duration: 1000
|
||||
})
|
||||
break
|
||||
default:
|
||||
Notify({
|
||||
message: '定位获取失败,请退出重试。',
|
||||
type: 'danger',
|
||||
duration: 1000
|
||||
})
|
||||
break
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
@@ -144,6 +144,22 @@ export default {
|
||||
this.position = { latitude, longitude }
|
||||
this.obtainData()
|
||||
} else {
|
||||
switch (result.status) {
|
||||
case 1:
|
||||
Notify({
|
||||
message: '用户拒绝对获取地理位置的请求。',
|
||||
type: 'danger',
|
||||
duration: 1000
|
||||
})
|
||||
break
|
||||
default:
|
||||
Notify({
|
||||
message: '定位获取失败,请退出重试。',
|
||||
type: 'danger',
|
||||
duration: 1000
|
||||
})
|
||||
break
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user