@@ -235,6 +235,11 @@ namespace Learun.Application.Organization | |||||
[Column("F_ORDER")] | [Column("F_ORDER")] | ||||
public int? F_Order { get; set; } | public int? F_Order { get; set; } | ||||
/// <summary> | |||||
/// 修改密码日期 | |||||
/// </summary> | |||||
[Column("F_MODIFYPWDDATE")] | |||||
public DateTime? F_ModifyPwdDate { get; set; } | |||||
#endregion | #endregion | ||||
#region 扩展操作 | #region 扩展操作 | ||||
@@ -515,6 +515,7 @@ namespace Learun.Application.Organization | |||||
userEntity.Modify(keyValue); | userEntity.Modify(keyValue); | ||||
userEntity.F_Secretkey = Md5Helper.Encrypt(CommonHelper.CreateNo(), 16).ToLower(); | 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_Password = Md5Helper.Encrypt(DESEncrypt.Encrypt(password, userEntity.F_Secretkey).ToLower(), 32).ToLower(); | ||||
userEntity.F_ModifyPwdDate = DateTime.Now; | |||||
this.BaseRepository().Update(userEntity); | this.BaseRepository().Update(userEntity); | ||||
} | } | ||||
catch (Exception ex) | catch (Exception ex) | ||||
@@ -570,6 +570,23 @@ namespace Learun.Application.Web.Controllers | |||||
{ | { | ||||
return Success(new { pwd = true }); | 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("登录成功"); | return Success("登录成功"); | ||||
} | } | ||||
#endregion | #endregion | ||||
@@ -7,6 +7,7 @@ | |||||
*/ | */ | ||||
var autoopenid = request('autoopen'); | var autoopenid = request('autoopen'); | ||||
var pwd = request("pwd"); | var pwd = request("pwd"); | ||||
var pwdtip = request("pwdtip"); | |||||
var bootstrap = function ($, learun) { | var bootstrap = function ($, learun) { | ||||
"use strict"; | "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 != "") { | if (ACIp != null && ACIp != "") { | ||||
//Ip上网 | //Ip上网 | ||||
@@ -164,6 +164,8 @@ | |||||
} else { | } else { | ||||
if (res.data.pwd == true) { | if (res.data.pwd == true) { | ||||
window.location.href = "/Home/Index?pwd=true"; | window.location.href = "/Home/Index?pwd=true"; | ||||
} else if (res.data.pwdtip == true) { | |||||
window.location.href = "/Home/Index?pwdtip=true"; | |||||
} | } | ||||
else | else | ||||
window.location.href = "/Home/Index"; | window.location.href = "/Home/Index"; | ||||