修改角色禁用

This commit is contained in:
2025-01-10 14:05:05 +08:00
parent 4cdf94d29c
commit 2509e26aae
5 changed files with 33 additions and 3 deletions
@@ -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