Merge branch 'light_v2'
This commit is contained in:
@@ -871,12 +871,14 @@ function Index() {
|
||||
|
||||
const updateLocation = async () => {
|
||||
try {
|
||||
const location = await getCurrentLocation();
|
||||
setCurrentLocation([location.latitude, location.longitude]);
|
||||
await updateUserInfo({
|
||||
latitude: location.latitude,
|
||||
longitude: location.longitude,
|
||||
});
|
||||
const location = await getCurrentLocation()
|
||||
setCurrentLocation([location.latitude, location.longitude])
|
||||
|
||||
// 使用 userStore 中的统一位置更新方法
|
||||
await updateUserInfo({ latitude: location.latitude, longitude: location.longitude })
|
||||
|
||||
// 位置更新后,重新获取详情页数据(因为距离等信息可能发生变化)
|
||||
await fetchDetail()
|
||||
} catch (error) {
|
||||
console.error("用户位置更新失败", error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user