feiyu02
2025-09-17 b330e57051e54789eb83d10dc58c4d9d10c608e1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { $fysp } from '../index';
 
export default {
  fetchDevice(sceneId) {
    return $fysp
      .get(`device`, {
        params: {
          sceneId: sceneId
        }
      })
      .then((res) => res.data);
  },
  // 获取设备
  fetchDevices(sceneId, deviceTypeId) {
    const params = `?sceneId=${sceneId}&deviceTypeId=${deviceTypeId}`;
    return $fysp
      .get(`device${params}`)
      .then((res) => res)
      .then((res) => res.data);
  },
  // 获取设备状态以及设备详情
  fetchDeviceStatus({ deviceId, sceneId, deviceTypeId }) {
    const params = `?deviceId=${deviceId}&sceneId=${sceneId}&deviceTypeId=${deviceTypeId}`;
    return $fysp
      .get(`device/status${params}`)
      .then((res) => res)
      .then((res) => res.data);
  }
};