From d667fce729c223e885930bb8edb528ab501b8d6a Mon Sep 17 00:00:00 2001 From: hcong <1050828145@qq.com> Date: 星期二, 26 十一月 2024 16:57:53 +0800 Subject: [PATCH] 1. 移动socket客户端类、新增socket/index.js文件(初始化) 2. socketMessage枚举类的完善(增加对每个类型的英文描述字段以及对类型筛选和判断是否为心跳消息的工具方法) 3. 在FYBgTaskCard.vue监听并处理如何刷后台任务状态逻辑 --- src/api/fysp/deviceApi.js | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/api/fysp/deviceApi.js b/src/api/fysp/deviceApi.js index 8dc9dd1..f95c919 100644 --- a/src/api/fysp/deviceApi.js +++ b/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); } }; -- Gitblit v1.9.3