From 82167463e469f4b62508e6c911086352c04c1078 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Thu, 16 Jan 2025 11:12:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=99=BB=E5=BD=95=E7=8A=B6?= =?UTF-8?q?=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Service/Management/DTO/UserModel.cs | 2 ++ IRaCIS.Core.Application/Service/Management/UserService.cs | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) 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