修改角色禁用
This commit is contained in:
@@ -615,6 +615,9 @@ namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionIdentityUserId = _userInfo.IdentityUserId, ActionUserName = _userInfo.UserName, TargetIdentityUserId = model.Id, OptType = model.Status == UserStateEnum.Enable ? UserOptType.AccountEnable : UserOptType.AccountLocked }, true);
|
||||
|
||||
|
||||
await _fusionCache.SetAsync(CacheKeys.UserDisable(user.Id), model.Status == UserStateEnum.Disable, TimeSpan.FromHours(1));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -636,6 +639,8 @@ namespace IRaCIS.Core.Application.Service
|
||||
if (find != null)
|
||||
{
|
||||
find.IsUserRoleDisabled = role.IsUserRoleDisabled;
|
||||
|
||||
await _fusionCache.SetAsync(CacheKeys.UserRoleDisable(find.Id), find.IsUserRoleDisabled, TimeSpan.FromHours(1));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -690,6 +695,9 @@ namespace IRaCIS.Core.Application.Service
|
||||
if (find != null)
|
||||
{
|
||||
find.IsUserRoleDisabled = role.IsUserRoleDisabled;
|
||||
|
||||
|
||||
await _fusionCache.SetAsync(CacheKeys.UserRoleDisable(find.Id), find.IsUserRoleDisabled, TimeSpan.FromHours(1));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1149,6 +1157,9 @@ namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
var jwt = _tokenService.GetToken(userTokenInfo);
|
||||
|
||||
|
||||
await _fusionCache.SetAsync(CacheKeys.UserToken(userTokenInfo.IdentityUserId), jwt, TimeSpan.FromDays(7));
|
||||
|
||||
return jwt;
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user