From 404600d8352b4ecac6daf963b63e01bec543fcb3 Mon Sep 17 00:00:00 2001 From: wujingjing <gersonwu@qq.com> Date: 星期三, 19 二月 2025 14:45:32 +0800 Subject: [PATCH] 定时获取位置 --- src/stores/chatRoom.ts | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/stores/chatRoom.ts b/src/stores/chatRoom.ts index cf0020d..abf64f8 100644 --- a/src/stores/chatRoom.ts +++ b/src/stores/chatRoom.ts @@ -9,6 +9,7 @@ import emitter from '../utils/mitt'; import { gotoRoute } from '../utils/route'; import { Local, LocalPlus } from '../utils/storage'; +import { getCurrentPosition } from '../utils/brower'; /** * Room 鍏宠仈鐨勪竴浜涢厤缃� @@ -83,10 +84,7 @@ // 涓诲満鏅� 鍒楄〃 export const sceneGroupList = ref([]); // groupType 鍒楄〃 -export const groupTypeList = computed(() => - Array.from(new Set(sceneGroupList.value.map((item) => item.group_type))) - -); +export const groupTypeList = computed(() => Array.from(new Set(sceneGroupList.value.map((item) => item.group_type)))); // 鍔炲叕/妯℃澘 鍒楄〃 export const exampleSceneList = ref([]); export const officeList = ref([]); @@ -280,3 +278,11 @@ }; export const currentPosition = ref<Position>(null); + +export const getGlobalPosition = () => { + getCurrentPosition(); + + setInterval(() => { + getCurrentPosition(); + }, 1000 * 60 * 60); +}; -- Gitblit v1.9.3