修改redis判断条件
parent
600418d0ab
commit
eb8f003d0c
|
|
@ -749,14 +749,19 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers
|
|||
// return result;
|
||||
// }
|
||||
//}
|
||||
var existingLocked = ParseClient(await _cache.HashGetAllAsync($"client:{info.DeviceSn}"));
|
||||
if (existingLocked.DeviceSn == info.DeviceSn && existingLocked.UserId != info.UserId && existingLocked.IsLock)
|
||||
var hashEntries = await _cache.HashGetAllAsync($"client:{info.DeviceSn}");
|
||||
if (hashEntries.Length > 0)
|
||||
{
|
||||
result.Code = 400;
|
||||
result.Message = "已有用户处于锁定状态,不能添加新的锁定用户。";
|
||||
result.Result = false;
|
||||
return result;
|
||||
var existingLocked = ParseClient(hashEntries);
|
||||
if (existingLocked.DeviceSn == info.DeviceSn && existingLocked.UserId != info.UserId && existingLocked.IsLock)
|
||||
{
|
||||
result.Code = 400;
|
||||
result.Message = "已有用户处于锁定状态,不能添加新的锁定用户。";
|
||||
result.Result = false;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
// 存客户端信息
|
||||
_cache.HashSetAsync(clientKey, new HashEntry[]
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue