吉安感知网项目-前端
罗广辉
2026-02-12 5cebaec98af8b4d36b5bf7d24e6d8592dd5cf724
uniapps/work-app/src/App.vue
@@ -4,7 +4,7 @@
import { useGlobalWS } from '@/hooks/useGlobalWS.js'
// #ifdef APP-PLUS
import { keepAliveStart, requestIgnoreBatteryOptimization } from '@/uni_modules/keep-app'
import { openDialog, allowFloat,getBatteryCapacity } from '@/uni_modules/lgh-dialog'
import { openDialog, allowFloat, getBatteryCapacity } from '@/uni_modules/lgh-dialog'
// #endif
const appStore = useAppStore()
@@ -24,11 +24,8 @@
// testKeep()
// 开启悬浮窗
allowFloat()
// allowFloat()
// 假设五秒后来电
setTimeout(() => {
   openDialog()
}, 5000)
// #endif
useGlobalWS()
@@ -57,9 +54,9 @@
   // 初始化系统信息
   appStore.initSystemInfo()
   // #ifdef APP-PLUS
   keepAliveStart()
   // keepAliveStart()
   // 请求用户允许忽略电池优化(重要:用于保活)
   setTimeout(requestIgnoreBatteryOptimization, 2000)
   // setTimeout(requestIgnoreBatteryOptimization, 2000)
   // #endif
   if (!userStore.userInfo) {
      //不存在则跳转至登录页
@@ -106,4 +103,3 @@
   background: transparent !important;
}
</style>