Compare commits

...

2 Commits

Author SHA1 Message Date
zhangbin 5876b2c0ee Merge branch 'main' of http://123.132.248.154:10000/HC_YFZX/LASAPlatform 2025-11-29 16:38:56 +08:00
zhangbin 9e50edb281 修改redis 2025-11-29 16:38:53 +08:00
1 changed files with 4 additions and 3 deletions

View File

@ -670,6 +670,7 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers
new("ClientId", info.ClientId),
new("UserId", info.UserId),
new("UserName", info.UserName),
new("DeviceSn", info.DeviceSn),
new("ConnectTime", info.ConnectTime.ToString("O")),
new("IsLock", info.IsLock ? "true" : "false")
});
@ -723,13 +724,13 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers
[AllowAnonymous]
public async Task<List<MqttClientResp>> GetLockedDeviceClients()
{
var userIds = await _cache.SetMembersAsync("locked_devices");
var deviceSns = await _cache.SetMembersAsync("locked_devices");
var result = new List<MqttClientResp>();
foreach (var userId in userIds)
foreach (var deviceSn in deviceSns)
{
var entries = await _cache.HashGetAllAsync($"client:{userId}");
var entries = await _cache.HashGetAllAsync($"client:{deviceSn}");
if (entries.Length > 0)
result.Add(ParseClient(entries));
}