移除地理位置缓存

This commit is contained in:
wangxiaowei
2026-01-06 16:26:06 +08:00
parent a32ad9188c
commit 65aa271098
2 changed files with 10 additions and 8 deletions

View File

@ -182,9 +182,10 @@
onShow(async () => {
// if (canLocation) {
// const location = await handleGetLocationCity(latitude.value, longitude.value)
// Index.handleResetSearch()
// Index.handleResetSearch()
// }
// canLocation.value = true
// 检测用户授权地理位置的缓存LOCATION_DENY_TIME_KEY
if (uni.getStorageSync(LOCATION_DENY_TIME_KEY)) {
const location = await checkLocationAuthWithModal()
if (location) {
@ -221,8 +222,9 @@
// 获取用户经纬度(带缓存和授权逻辑)
const { lat, lng } = await handleEnsureLocationAuthHooks()
latitude.value = lat
longitude.value = lng
longitude.value = lng
// 根据经纬度获取城市信息再重新赋值经纬度和城市
const location = await handleGetLocationCity(lat, lng)
city.value = location.city
latitude.value = location.latitude