Browse Source

【修改】拿初始密码登录的进行提示;

西昌分支
dyy 6 months ago
parent
commit
a6086b6f85
4 changed files with 46 additions and 16 deletions
  1. +32
    -8
      Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/LoginController.cs
  2. +7
    -2
      Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/AdminDefault/index.js
  3. +6
    -5
      Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/Default/Index.js
  4. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config

+ 32
- 8
Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/LoginController.cs View File

@@ -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("<script>alert('" + lc.Message + "');location.href='/ShowRegister/Index';</script>");
}
}
#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
{


+ 7
- 2
Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/AdminDefault/index.js View File

@@ -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 != "") {


+ 6
- 5
Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/Default/Index.js View File

@@ -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) {


+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config View File

@@ -155,7 +155,7 @@
<add key="ACIp" value="192.168.90.2"/>
<add key="ACIp2" value="192.168.200.252"/>
<!-- 是否强制验证强密码 -->
<add key="verifypwd" value="false"/>
<add key="verifypwd" value="true"/>
<!--疫情防控组角色Id-->
<add key="EpidemicControlTeamRoleId" value="87f38e4e-b0a6-472c-b01a-2620b8f1ec46" />
<!--注册教师生成编号 金隅:jy;西昌:xc;大厂:dc-->


Loading…
Cancel
Save