diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/HomeController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/HomeController.cs index 60dd53c08..f16f2ebde 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/HomeController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/HomeController.cs @@ -73,6 +73,11 @@ namespace Learun.Application.Web.Controllers { return View(); } + + public ActionResult ChangePwdOfFirstLogin() + { + return View(); + } #region 统一身份认证2.0 public ActionResult SSOApplication() diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/UserCenterController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/UserCenterController.cs index 20992133d..a4e1aba34 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/UserCenterController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/UserCenterController.cs @@ -353,6 +353,20 @@ namespace Learun.Application.Web.Controllers OperatorHelper.Instance.EmptyCurrent(); return Success("密码修改成功,请牢记新密码。\r 将会自动安全退出。"); } + [HttpPost] + [AjaxOnly] + public ActionResult SubmitResetPasswordidenNoCode(string password, string oldPassword) + { + bool res = userIBLL.RevisePasswordiden(password, oldPassword); + if (!res) + { + return Fail("原密码错误,请重新输入"); + } + Session.Abandon(); + Session.Clear(); + OperatorHelper.Instance.EmptyCurrent(); + return Success("密码修改成功,请牢记新密码。\r 将会自动安全退出。"); + } [HttpPost] [AjaxOnly] diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj index 7cdd9f0e4..87ac6d39a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj @@ -4230,6 +4230,7 @@ + @@ -8130,6 +8131,7 @@ + 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 f4a72e5d0..9bf337211 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 @@ -199,8 +199,8 @@ var bootstrap = function ($, learun) { // }); //} - - if (pwd == "true" || sessionStorage.getItem("pase_29d") == "hm") { + //弱密码/初始密码登录,强制修改弹框 + if (sessionStorage.getItem("pase_29d") == "hm") { top.layer.open({ id: 'pwdform', title: '密码修改', @@ -230,7 +230,39 @@ var bootstrap = function ($, learun) { } }); } - if (pwd == "first" || sessionStorage.getItem("pase_29d") == "fs") { + //登录页-(新生手机号)首次登录,强制修改弹框 + if (sessionStorage.getItem("pase_29d") == "hmfl") { + top.layer.open({ + id: 'pwdform', + title: '密码修改', + closeBtn: 0, + resize: false, + type: 2, + skin: 'lr-layer', + btn: ['确定'], + content: top.$.rootUrl + '/Home/ChangePwdOfFirstLogin', + area: ['500px', '300px'], + success: function (layero, index) { + top['layer_pwdform'] = learun.iframe($(layero).find('iframe').attr('id'), top.frames); + layero[0].learun_layerid = 'layer_pwdform'; + }, + yes: function (index, layero) { + var flag = top['layer_pwdform'].acceptClick(function () { + //删除seesion + sessionStorage.removeItem("pase_29d"); + top.location.href = "/Login/Index"; + }); + if (!!flag) { + learun.layerClose('', index); + } + }, + end: function () { + top['layer_pwdform'] = null; + } + }); + } + //首次登录微信绑定,强制修改弹框 + if (sessionStorage.getItem("pase_29d") == "fs") { top.layer.open({ id: 'pwdform', title: '密码修改', diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/ChangePwdOfFirstLogin.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/ChangePwdOfFirstLogin.cshtml new file mode 100644 index 000000000..6bacf84d6 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/ChangePwdOfFirstLogin.cshtml @@ -0,0 +1,23 @@ +@{ + ViewBag.Title = "首次登录强制改密"; + Layout = "~/Views/Shared/_Form.cshtml"; +} + + + 身份证后八位* + + + + 新密码* + + + + 确认密码* + + + + + 新密码必须8-20位同时包含1.[大小写字母]、2[数字]、3[特殊符号!@@#$%^&*] + + +@Html.AppendJsFile("/Views/Home/ChangePwdOfFirstLogin.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/ChangePwdOfFirstLogin.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/ChangePwdOfFirstLogin.js new file mode 100644 index 000000000..3a768632e --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/ChangePwdOfFirstLogin.js @@ -0,0 +1,56 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2019-07-18 15:18 + * 描 述:首次登录强制改密 + */ +var acceptClick; +var keyValue = request('keyValue'); +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + }, + bind: function () { + $("#NewPwd2").blur(function () { + var $this = $(this); + if ($this.val() == "") { + return false; + } + if ($this.val() != $('#NewPwd').val()) { + learun.alert.error("两次密码输入不一样"); + } + }); + } + }; + // 保存数据 + acceptClick = function (callBack) { + if (!$('body').lrValidform()) { + return false; + } + if ($("#OldPwd").val().length != 8) { + learun.alert.error("旧密码输入不正确,请重新确认"); + return false; + } + if ($("#NewPwd2").val() != $('#NewPwd').val()) { + learun.alert.error("新密码和确认密码输入不一致,请修改"); + return false; + } + var formData = $('body').lrGetFormData(); + var postData = { + password: $.md5(formData.NewPwd), + oldPassword: formData.OldPwd + }; + $.lrSaveForm(top.$.rootUrl + '/UserCenter/SubmitResetPasswordidenNoCode', postData, function (res) { + if (res.code == 200) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/Default/FirstIndexWxLogin.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/Default/FirstIndexWxLogin.js index 3e9a0eb51..3b4241604 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/Default/FirstIndexWxLogin.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/Default/FirstIndexWxLogin.js @@ -155,7 +155,7 @@ if (res.data.pwd == true) { //存储seesion sessionStorage.setItem("pase_29d", "fs"); - window.location.href = "/Home/Index?pwd=first"; + window.location.href = "/Home/Index"; } else { window.location.href = "/Home/Index"; 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 e0a02413e..0ad0e5e73 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 @@ -320,7 +320,7 @@ if (res.code == 200) { if (res.data.pwd == true) { //存储seesion - sessionStorage.setItem("pase_29d", "hm"); + sessionStorage.setItem("pase_29d", "hmfl"); window.location.href = "/Home/Index"; } } else { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/ForgotPassword.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/ForgotPassword.cshtml index 0762a7752..d4b6b682e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/ForgotPassword.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/ForgotPassword.cshtml @@ -117,7 +117,7 @@ * - + 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 d67fe1707..45d1bb8fa 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config @@ -156,7 +156,7 @@ - + diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/forgotPassword.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/forgotPassword.vue index f92cbe6c9..9b9090744 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/forgotPassword.vue +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/forgotPassword.vue @@ -1,13 +1,13 @@ - + 发送验证码 - + @@ -20,7 +20,7 @@ 下一步 - + diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/my/newpassword.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/my/newpassword.vue index 4f6beb767..9ef579be2 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/my/newpassword.vue +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/my/newpassword.vue @@ -42,7 +42,7 @@ // newPwd, // confirmPwd // } = this - if (this.oldPwd.length < 6) { + if (this.oldPwd.length != 8) { this.CONFIRM('操作失败', '旧密码输入不正确,请重新确认') return }