Use fuzzy location for bind fallback
This commit is contained in:
@@ -55,5 +55,5 @@ export default defineAppConfig({
|
||||
desc: "用于定位设备位置",
|
||||
},
|
||||
},
|
||||
requiredPrivateInfos: ["getLocation"],
|
||||
requiredPrivateInfos: ["getFuzzyLocation"],
|
||||
});
|
||||
|
||||
@@ -216,15 +216,13 @@ export default function Bind() {
|
||||
if (!normalizedDeviceId) return
|
||||
|
||||
try {
|
||||
const location = await Taro.getLocation({
|
||||
const location = await Taro.getFuzzyLocation({
|
||||
type: 'gcj02',
|
||||
isHighAccuracy: true,
|
||||
})
|
||||
await reportBindInitialLocation(normalizedDeviceId, {
|
||||
latitude: location.latitude,
|
||||
longitude: location.longitude,
|
||||
coord_type: 'gcj02',
|
||||
accuracy_m: typeof location.accuracy === 'number' ? Math.round(location.accuracy) : undefined,
|
||||
})
|
||||
} catch (error) {
|
||||
console.log('[bind] initial location skipped:', error)
|
||||
|
||||
Reference in New Issue
Block a user