update: 添加设备管理页面实时在线状态显示功能

This commit is contained in:
3030332422
2025-09-17 11:36:20 +08:00
parent 15ca08ce14
commit 44e7380c6b
5 changed files with 89 additions and 1 deletions
@@ -85,4 +85,21 @@ export default {
});
}).send();
},
// 获取设备状态
getDeviceStatus(agentId, callback) {
RequestService.sendRequest()
.url(`${getServiceUrl()}/device/bind/${agentId}`)
.method('POST')
.data({}) // 发送空对象作为请求体
.success((res) => {
RequestService.clearRequestTime();
callback(res);
})
.networkFail((err) => {
console.error('获取设备状态失败:', err);
RequestService.reAjaxFun(() => {
this.getDeviceStatus(agentId, callback);
});
}).send();
},
}