修改redis判断条件

main
zhangbin 2025-12-23 14:06:15 +08:00
parent 600418d0ab
commit eb8f003d0c
1 changed files with 11 additions and 6 deletions

View File

@ -749,7 +749,10 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers
// return result; // return result;
// } // }
//} //}
var existingLocked = ParseClient(await _cache.HashGetAllAsync($"client:{info.DeviceSn}")); var hashEntries = await _cache.HashGetAllAsync($"client:{info.DeviceSn}");
if (hashEntries.Length > 0)
{
var existingLocked = ParseClient(hashEntries);
if (existingLocked.DeviceSn == info.DeviceSn && existingLocked.UserId != info.UserId && existingLocked.IsLock) if (existingLocked.DeviceSn == info.DeviceSn && existingLocked.UserId != info.UserId && existingLocked.IsLock)
{ {
result.Code = 400; result.Code = 400;
@ -757,6 +760,8 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers
result.Result = false; result.Result = false;
return result; return result;
} }
}
// 存客户端信息 // 存客户端信息
_cache.HashSetAsync(clientKey, new HashEntry[] _cache.HashSetAsync(clientKey, new HashEntry[]
{ {