diff --git a/IRaCIS.Core.Application/Service/Management/DTO/UserModel.cs b/IRaCIS.Core.Application/Service/Management/DTO/UserModel.cs index a05e65145..a523e0e1f 100644 --- a/IRaCIS.Core.Application/Service/Management/DTO/UserModel.cs +++ b/IRaCIS.Core.Application/Service/Management/DTO/UserModel.cs @@ -99,6 +99,8 @@ namespace IRaCIS.Application.Contracts public bool IsZhiZhun { get; set; } public bool IsFirstAdd { get; set; } + public bool NeedChangePassWord { get; set; } = false; + public bool PasswordChanged { get; set; } diff --git a/IRaCIS.Core.Application/Service/Management/UserService.cs b/IRaCIS.Core.Application/Service/Management/UserService.cs index e60ae1639..dba110cb8 100644 --- a/IRaCIS.Core.Application/Service/Management/UserService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserService.cs @@ -887,7 +887,8 @@ namespace IRaCIS.Core.Application.Service //超过90天没修改密码 if (_verifyConfig.CurrentValue.IsNeedChangePassWord && loginUser.LastChangePassWordTime != null && DateTime.Now.AddDays(-_verifyConfig.CurrentValue.ChangePassWordDays) > loginUser.LastChangePassWordTime.Value) { - loginUser.LoginState = 1; + loginUser.NeedChangePassWord = true; + } //await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, LoginUserId = loginUser.IdentityUserId, OptUserId = loginUser.IdentityUserId, OptType = UserOptType.Login }, true); @@ -1052,7 +1053,7 @@ namespace IRaCIS.Core.Application.Service //超过90天没修改密码 if (_verifyConfig.CurrentValue.IsNeedChangePassWord && loginUser.LastChangePassWordTime != null && DateTime.Now.AddDays(-_verifyConfig.CurrentValue.ChangePassWordDays) > loginUser.LastChangePassWordTime.Value) { - loginUser.LoginState = 1; + loginUser.NeedChangePassWord = true; } #endregion