From f64c9e5dae3519f6b470b2ff5f80d07fa75f835f Mon Sep 17 00:00:00 2001 From: xiebing Date: Fri, 19 Dec 2025 16:05:16 +0800 Subject: [PATCH] bug fix --- App.vue | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/App.vue b/App.vue index 1cd0f97..49182bf 100644 --- a/App.vue +++ b/App.vue @@ -33,16 +33,18 @@ onLaunch((options) => { useUserStore().logOutApp(); useUserStore().changMiniProgramAppStatus(true); useUserStore().changMachineEnv(true); - useLocationStore().getLocation() - .then(({longitude,latitude})=>{ - console.log(`✅一体机获取定位成功:lng:${longitude},lat${latitude}`) - }) - .catch(err=>{ - console.log('❌一体机获取定位失败,30s后尝试重新获取') - setTimeout(() => { - useLocationStore().getLocation() - }, 3000); - }) + (function loop() { + console.log('📍一体机尝试获取定位') + useLocationStore().getLocation().then(({longitude,latitude})=>{ + console.log(`✅一体机获取定位成功:lng:${longitude},lat${latitude}`) + }) + .catch(err=>{ + console.log('❌一体机获取定位失败,30s后尝试重新获取') + setTimeout(() => { + loop() + }, 3000); + }) + })() uQRListen = new IncreaseRevie(); inactivityManager = new GlobalInactivityManager(handleInactivity, 60 * 1000); inactivityManager.start();