1
This commit is contained in:
@@ -80,11 +80,11 @@ module.exports = {
|
||||
}
|
||||
|
||||
const accountData = account.toJSON();
|
||||
|
||||
|
||||
// 从 deviceManager 获取在线状态
|
||||
const deviceStatus = deviceManager.getAllDevicesStatus();
|
||||
const onlineStatus = deviceStatus[deviceSn] || { isOnline: false };
|
||||
|
||||
|
||||
// 组合返回数据
|
||||
const deviceData = {
|
||||
sn_code: accountData.sn_code,
|
||||
@@ -92,6 +92,8 @@ module.exports = {
|
||||
deviceName: accountData.name || accountData.sn_code,
|
||||
platform: accountData.platform_type,
|
||||
isOnline: onlineStatus.isOnline || false,
|
||||
is_online: onlineStatus.isOnline || false, // 前端使用的字段名
|
||||
is_logged_in: onlineStatus.isLoggedIn || false, // 从 deviceManager 内存中获取登录状态
|
||||
isRunning: false, // 不再维护运行状态
|
||||
lastHeartbeatTime: onlineStatus.lastHeartbeat ? new Date(onlineStatus.lastHeartbeat) : null,
|
||||
accountName: accountData.name,
|
||||
|
||||
Reference in New Issue
Block a user