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";