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