songshankun
2023-11-06 61dedbff9e9965eda9c91be5cc0e64f0db7db22e
src/stores/devices.ts
@@ -1,14 +1,15 @@
import { computed, onUnmounted, ref } from 'vue'
import { computed } from 'vue'
import { defineStore } from 'pinia'
import { apiSetCurrentDevice, getDeviceList } from '@/api'
import type { SetCurrentDeviceParams } from '@/api'
import { getDeviceList } from '@/api'
import { useRequest } from 'vue-hooks-plus'
import type { Devices } from '@/api/device'
import { DEVICE_INFO_POLLING_DURATION } from '@/common/constants'
import { ElMessage } from 'element-plus'
export const useDevicesStore = defineStore('device', () => {
  const deviceInfo = computed(() => {
    if (deviceInfo?.value) {
      deviceRes.value.data.currentDeviceID = 'wwwwwwww222222'
    }
    return deviceRes?.value?.data as Devices
  })