修改首页默认经纬度
This commit is contained in:
+7
-1
@@ -314,10 +314,16 @@ const getCurrentLocation = async () => {
|
||||
// 获取当前位置
|
||||
// const location = localStorage.getItem('userLocation')?JSON.parse(localStorage.getItem('userLocation')):await WechatLocation.getLocation('gcj02');
|
||||
// 修改为从 cookie 获取位置信息
|
||||
const location = getCookie('userLocation') || await WechatLocation.getLocation('gcj02');
|
||||
let location = getCookie('userLocation') || await WechatLocation.getLocation('gcj02');
|
||||
console.log('当前位置:', location);
|
||||
const userStore = useUserStore();
|
||||
// 解析位置获取城市信息
|
||||
if (!location || !location.latitude || !location.longitude) {
|
||||
location = {
|
||||
latitude: '24.479627',
|
||||
longitude: '118.08891'
|
||||
};
|
||||
}
|
||||
if (location && location.latitude && location.longitude) {
|
||||
// if(localStorage.getItem('cityInfo')){
|
||||
// 修改为从 cookie 获取城市信息
|
||||
|
||||
Reference in New Issue
Block a user