移除地理位置缓存

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

@ -152,12 +152,12 @@ export function handleSetLocationCacheHooks(lat: number, lng: number) {
// VERSION1: 初始化经纬度
export async function handleEnsureLocationAuthHooks() {
// 1. 检查缓存
if (handleCheckLocationCacheHooks()) {
const lat = uni.getStorageSync(LOCATION_LAT_KEY)
const lng = uni.getStorageSync(LOCATION_LNG_KEY)
if (lat && lng) return { lat, lng }
}
// 1. 检查缓存-先把缓存去掉
// if (handleCheckLocationCacheHooks()) {
// const lat = uni.getStorageSync(LOCATION_LAT_KEY)
// const lng = uni.getStorageSync(LOCATION_LNG_KEY)
// if (lat && lng) return { lat, lng }
// }
// 2. 获取定位
return new Promise<{ lat: number, lng: number, }>((resolve) => {