hcong
2024-11-15 18eee6f8818b864d1f8d8fb56298620921f909e4
src/api/fysp/deviceApi.js
@@ -11,13 +11,19 @@
      .then((res) => res.data);
  },
  // 获取设备
  async fetchDevices(sceneId, deviceTypeId) {
  fetchDevices(sceneId, deviceTypeId) {
    const params = `?sceneId=${sceneId}&deviceTypeId=${deviceTypeId}`;
    return await $fysp.get(`device${params}`).then((res) => res).then((res) => res.data);
    return $fysp
      .get(`device${params}`)
      .then((res) => res)
      .then((res) => res.data);
  },
  // 获取设备状态以及设备详情
  async fetchDeviceStatus({deviceId, sceneId, deviceTypeId}) {
  fetchDeviceStatus({ deviceId, sceneId, deviceTypeId }) {
    const params = `?deviceId=${deviceId}&sceneId=${sceneId}&deviceTypeId=${deviceTypeId}`;
    return await $fysp.get(`device/status${params}`).then((res) => res).then((res) => res.data);
    return $fysp
      .get(`device/status${params}`)
      .then((res) => res)
      .then((res) => res.data);
  }
};