mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-25 00:23:53 +08:00
update: 添加设备管理页面实时在线状态显示功能
This commit is contained in:
@@ -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();
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user