From a6086b6f85ac541d3e410bbff8c618f110aac4a7 Mon Sep 17 00:00:00 2001
From: dyy <807692433@qq.com>
Date: Wed, 15 May 2024 09:28:26 +0800
Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91=E6=8B=BF?=
=?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=AF=86=E7=A0=81=E7=99=BB=E5=BD=95=E7=9A=84?=
=?UTF-8?q?=E8=BF=9B=E8=A1=8C=E6=8F=90=E7=A4=BA=EF=BC=9B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Controllers/LoginController.cs | 40 +++++++++++++++----
.../Views/Home/AdminDefault/index.js | 9 ++++-
.../Views/Login/Default/Index.js | 11 ++---
.../XmlConfig/system.config | 2 +-
4 files changed, 46 insertions(+), 16 deletions(-)
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 cfeca65ef..d312ca97f 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/LoginController.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/LoginController.cs
@@ -209,8 +209,8 @@ namespace Learun.Application.Web.Controllers
[HttpGet]
public ActionResult Index()
{
- #if DEBUG
- #else
+#if DEBUG
+#else
//判断当前ip是否是123服务器,如果是123服务器,跳过授权验证
if (Net.GetLanIp() != "172.17.3.181")
{
@@ -221,7 +221,7 @@ namespace Learun.Application.Web.Controllers
return Content("");
}
}
- #endif
+#endif
//获取错误次数
ViewBag.errornum = OperatorHelper.Instance.GetCurrentErrorNum();
//获取高职版跳转地址
@@ -604,10 +604,12 @@ namespace Learun.Application.Web.Controllers
logEntity.F_ExecuteResultJson = "登录成功";
logEntity.WriteLog();
OperatorHelper.Instance.ClearCurrentErrorNum();
+ //结果
+ var succresult = new SuccResult();
//是否强密码验证
if (!string.IsNullOrEmpty(ConfigurationManager.AppSettings["verifypwd"]) && ConfigurationManager.AppSettings["verifypwd"] == "true" && up == "false")
{
- return Success(new { pwd = true });
+ succresult.pwd = true;
}
//是否30天未修改密码验证
//获取开关显示配置中“30天未修改密码登录后提示修改”项的配置
@@ -617,22 +619,44 @@ namespace Learun.Application.Web.Controllers
{
if ((DateTime.Now - userEntity.F_ModifyPwdDate.Value).Days > 30)
{
- return Success(new { pwdtip = true });
+ succresult.pwdtip = true;
}
}
else
{
if (userEntity.F_CreateDate.HasValue && (DateTime.Now - userEntity.F_CreateDate.Value).Days > 30)
{
- return Success(new { pwdtip = true });
+ succresult.pwdtip = true;
}
}
}
+ //是否初始密码
+ if (string.IsNullOrEmpty(userEntity.F_IdentityCardNo))
+ {
+ if (password == Md5Helper.Encrypt(Config.GetValue("pwdprex") + "123456", 32) || password == Md5Helper.Encrypt(Config.GetValue("pwdprex") + "2020", 32) || password == Md5Helper.Encrypt(Config.GetValue("defaultpwd"), 32))
+ {
+ succresult.defaultPwdTip = true;
+ }
+ }
+ else
+ {
+ if (password == Md5Helper.Encrypt(Config.GetValue("pwdprex") + userEntity.F_IdentityCardNo.Substring(userEntity.F_IdentityCardNo.Length - 6, 6), 32) || password == Md5Helper.Encrypt(Config.GetValue("pwdprex") + "2020", 32) || password == Md5Helper.Encrypt(Config.GetValue("defaultpwd"), 32))
+ {
+ succresult.defaultPwdTip = true;
+ }
+ }
+
- return Success("登录成功");
+ return Success(succresult);
}
#endregion
}
+ public class SuccResult
+ {
+ public bool pwd { get; set; }
+ public bool pwdtip { get; set; }
+ public bool defaultPwdTip { get; set; }
+ }
#endregion
#region 飞星网盘
@@ -935,7 +959,7 @@ namespace Learun.Application.Web.Controllers
ViewBag.CODE = Request.QueryString["CODE"];
if (!string.IsNullOrEmpty(ViewBag.login))
{
- return Redirect("https://open.weixin.qq.com/connect/qrconnect?appid=" + appid + "&redirect_uri=" + redirect_url + "%2fLogin%2fLoginForWeixin&response_type=code&scope=snsapi_login&state="+ ViewBag.state + "#wechat_redirect");
+ return Redirect("https://open.weixin.qq.com/connect/qrconnect?appid=" + appid + "&redirect_uri=" + redirect_url + "%2fLogin%2fLoginForWeixin&response_type=code&scope=snsapi_login&state=" + ViewBag.state + "#wechat_redirect");
}
else
{
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 e3a636f8b..503787816 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
@@ -198,6 +198,11 @@ var bootstrap = function ($, learun) {
// area: ['500px', '300px']
// });
//}
+
+ //初始密码进行提示
+ if (sessionStorage.getItem("df0fjl") == "hm") {
+ layer.alert("您当前密码为初始密码,请尽快修改!", { icon: 7, title: "提示", closeBtn: false, yes: function (index) { sessionStorage.removeItem("df0fjl"); layer.close(index); } });
+ }
if (pwd == "true" || sessionStorage.getItem("pase_29d") == "hm") {
top.layer.open({
id: 'pwdform',
@@ -259,8 +264,8 @@ var bootstrap = function ($, learun) {
});
}
//30天未修改密码进行提示
- if (pwdtip == "true") {
- layer.alert("您已30天未修改密码,请先修改!", {icon:7, title: "提示", yes: function (index) { layer.close(index) } });
+ if (pwdtip == "true" || sessionStorage.getItem("pt580") == "hm") {
+ layer.alert("您已30天未修改密码,请先修改!", { icon: 7, title: "提示", closeBtn: false, yes: function (index) { sessionStorage.removeItem("pt580"); layer.close(index); } });
}
//上网认证
if (ACIp != null && ACIp != "") {
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 ef91baea4..3d696a04a 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
@@ -165,13 +165,14 @@
if (res.data.pwd == true) {
//存储seesion
sessionStorage.setItem("pase_29d", "hm");
- 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";
+ if (res.data.pwdtip == true) {
+ sessionStorage.setItem("pt580", "hm");
}
+ if (res.data.defaultPwdTip == true) {
+ sessionStorage.setItem("df0fjl", "hm");
+ }
+ window.location.href = "/Home/Index";
}
}
else if (res.code == 400) {
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config b/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config
index 4729deddb..54e515c5d 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config
@@ -155,7 +155,7 @@
-
+