From cbf0f1151eeab1a75cf70d656687f08b7b240863 Mon Sep 17 00:00:00 2001 From: dyy <807692433@qq.com> Date: Tue, 8 Mar 2022 12:10:00 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=A2=9E=E5=8A=A0=E3=80=9130=E5=A4=A9?= =?UTF-8?q?=E6=9C=AA=E4=BF=AE=E6=94=B9=E5=AF=86=E7=A0=81=E5=BC=B9=E6=A1=86?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../User/UserEntity.cs | 5 +++++ .../User/UserService.cs | 1 + .../Controllers/LoginController.cs | 17 +++++++++++++++++ .../Views/Home/AdminDefault/index.js | 5 +++++ .../Views/Login/Default/Index.js | 2 ++ 5 files changed, 30 insertions(+) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserEntity.cs b/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserEntity.cs index 4884149af..db38418f1 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserEntity.cs @@ -235,6 +235,11 @@ namespace Learun.Application.Organization [Column("F_ORDER")] public int? F_Order { get; set; } + /// + /// 修改密码日期 + /// + [Column("F_MODIFYPWDDATE")] + public DateTime? F_ModifyPwdDate { get; set; } #endregion #region 扩展操作 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserService.cs b/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserService.cs index 51cb0b952..78b9997b2 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserService.cs @@ -515,6 +515,7 @@ namespace Learun.Application.Organization userEntity.Modify(keyValue); userEntity.F_Secretkey = Md5Helper.Encrypt(CommonHelper.CreateNo(), 16).ToLower(); userEntity.F_Password = Md5Helper.Encrypt(DESEncrypt.Encrypt(password, userEntity.F_Secretkey).ToLower(), 32).ToLower(); + userEntity.F_ModifyPwdDate = DateTime.Now; this.BaseRepository().Update(userEntity); } catch (Exception ex) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/LoginController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/LoginController.cs index 0917c4546..de541d24a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/LoginController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/LoginController.cs @@ -570,6 +570,23 @@ namespace Learun.Application.Web.Controllers { return Success(new { pwd = true }); } + //是否30天未修改密码验证 + //TODO:获取开关配置中“30天未修改密码进行提示”项的配置 + if (userEntity.F_ModifyPwdDate.HasValue) + { + if ((DateTime.Now-userEntity.F_ModifyPwdDate.Value).Days>30) + { + return Success(new { pwdtip = true }); + } + } + else + { + if (userEntity.F_CreateDate.HasValue && (DateTime.Now-userEntity.F_CreateDate.Value).Days>30) + { + return Success(new { pwdtip=true }); + } + } + return Success("登录成功"); } #endregion diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/AdminDefault/index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/AdminDefault/index.js index 928cc635c..76e7aa1bd 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/AdminDefault/index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/AdminDefault/index.js @@ -7,6 +7,7 @@ */ var autoopenid = request('autoopen'); var pwd = request("pwd"); +var pwdtip = request("pwdtip"); var bootstrap = function ($, learun) { "use strict"; // 菜单操作 @@ -225,6 +226,10 @@ var bootstrap = function ($, learun) { } }); } + //30天未修改密码进行提示 + if (pwdtip == "true") { + layer.alert("您已30天未修改密码,请先修改!", { title: "提示", yes: function (index) { layer.close(index) } }); + } //上网认证 if (ACIp != null && ACIp != "") { //Ip上网 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/Default/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/Default/Index.js index ece31d495..0d5ebb737 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/Default/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/Default/Index.js @@ -164,6 +164,8 @@ } else { if (res.data.pwd == true) { window.location.href = "/Home/Index?pwd=true"; + } else if (res.data.pwdtip == true) { + window.location.href = "/Home/Index?pwdtip=true"; } else window.location.href = "/Home/Index";