| 1234567891011121314151617181920212223242526272829303132 |
- /**
- * 设备模块 API
- */
- import http from '@/utils/http'
- /**
- * 获取当前账号下的设备列表
- * 后端通过 Token 获取当前 APP 账号,返回该账号可使用的家庭设备和公共设备
- * @returns {Promise<Array<{id, deviceId, deviceCode, deviceName, deviceModel, deviceType, deviceTypeName, serialNo, firmwareVersion, onlineStatus, lastOnlineTime, address, groupId, memberId, profileId, profileName, profileComplete}>>}
- */
- export function getDeviceList() {
- return http.get('/app/device/list',{showError:true})
- }
- /**
- * 用户手动输入设备编号绑定设备
- * @param {string} deviceCode - 设备编号
- * @returns {Promise<{id, userId, deviceCode, deviceName, deviceModel, isPrimary, onlineStatus, status, bindTime, createTime, updateTime}>}
- */
- export function bindDeviceByCode(deviceCode) {
- console.log("请求参数",deviceCode)
- return http.post('/app/user/device/bind-by-code', {deviceCode },{showError:true})
- }
- /**
- * 获取设备详情
- * @param {string|number} id - 设备ID
- * @returns {Promise<{id, deviceCode, deviceName, deviceModel, deviceType, serialNo, firmwareVersion, onlineStatus, lastOnlineTime, provinceCode, cityCode, districtCode, address, remark, createTime, updateTime}>}
- */
- export function getDeviceDetail(id) {
- return http.get(`/app/device/${id}`, {showError: true})
- }
|