haoxuan
2023-11-06 2bb9a863e75312fe90869ea3deea137b46b1bb1e
src/stores/devices.ts
@@ -1,4 +1,4 @@
import { computed, onUnmounted } from 'vue'
import { computed } from 'vue'
import { defineStore } from 'pinia'
import { getDeviceList } from '@/api'
import { useRequest } from 'vue-hooks-plus'
@@ -7,6 +7,9 @@
export const useDevicesStore = defineStore('device', () => {
  const deviceInfo = computed(() => {
    if (deviceInfo?.value) {
      deviceRes.value.data.currentDeviceID = 'wwwwwwww222222'
    }
    return deviceRes?.value?.data as Devices
  })
@@ -27,10 +30,6 @@
    cancelDevicePolling()
    startDevicePolling()
  }
  onUnmounted(() => {
    cancelDevicePolling()
  })
  return { deviceInfo, startPollingDevice }
})