From 1897ba0c916bf55f8f3651d15dc0c7fa2f641403 Mon Sep 17 00:00:00 2001 From: zhichao lei <442149704@qq.com> Date: Tue, 19 Jan 2021 12:27:44 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E6=A1=8C=E9=9D=A2=E4=B8=8A=E5=BE=85?= =?UTF-8?q?=E5=8A=9E=E6=95=B0=E9=87=8F=E4=BF=AE=E6=AD=A3=EF=BC=8C=E5=92=8C?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E5=9B=BE=E6=A0=87=E6=98=BE=E7=A4=BA=E4=B8=8D?= =?UTF-8?q?=E5=85=A8=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Learun.Application.Web/Controllers/HomeController.cs | 2 +- .../Learun.Application.Web/Views/Home/AdminDesktopTop.cshtml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 3a789cc9e..95b3a570b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/HomeController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/HomeController.cs @@ -423,7 +423,7 @@ namespace Learun.Application.Web.Controllers #region 待办 var userinfo = LoginUserInfo.Get(); - Pagination paginationobj = new Pagination() { rows = 5, page = 1, sidx = "readflag asc,SENDTIME desc ", sord = "desc" }; + Pagination paginationobj = new Pagination() { rows = 100, page = 1, sidx = "readflag asc,SENDTIME desc ", sord = "desc" }; //未读邮件 ViewBag.UnreadMail = sYS_ReceiveMessageIBLL.GetPageList(paginationobj, "{\"userId\":\"" + userinfo.userId + "\"}").Count(m => m.READFLAG == 0); //办公事项 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/AdminDesktopTop.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/AdminDesktopTop.cshtml index 4993ddef0..06d402508 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/AdminDesktopTop.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/AdminDesktopTop.cshtml @@ -314,7 +314,7 @@ .lr-scroll-wrap { position: relative; overflow: hidden; - height: 100%; + height: 70%; width: 100% } From 03c2b0c6853279a908200bf496629665d6025224 Mon Sep 17 00:00:00 2001 From: dyy <18335927079@163.com> Date: Tue, 19 Jan 2021 12:27:59 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E3=80=90=E5=A2=9E=E5=8A=A0=E3=80=91?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E4=B8=AD=E5=BF=83-=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=EF=BC=8C=E5=A2=9E=E5=8A=A0=E2=80=9D=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=AF=86=E7=A0=81=E9=85=8D=E7=BD=AE=E2=80=9C=EF=BC=9B?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E4=B8=AD=E8=AF=BB=E5=8F=96config=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=AF=86=E7=A0=81=E7=9A=84=E4=BB=A3=E7=A0=81=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E8=AF=BB=E5=8F=96=E2=80=9D=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=AF=86=E7=A0=81=E9=85=8D=E7=BD=AE=E2=80=9C=E4=B8=AD=E5=B7=B2?= =?UTF-8?q?=E5=90=AF=E7=94=A8=E7=9A=84=E5=AF=86=E7=A0=81=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../User/UserBLL.cs | 8 +- .../User/UserIBLL.cs | 6 +- .../Sys_DefaultPwdConfigController.cs | 131 +++++++++++ .../Views/Sys_DefaultPwdConfig/Form.cshtml | 15 ++ .../Views/Sys_DefaultPwdConfig/Form.js | 51 +++++ .../Views/Sys_DefaultPwdConfig/Index.cshtml | 39 ++++ .../Views/Sys_DefaultPwdConfig/Index.js | 112 +++++++++ .../Controllers/UserController.cs | 20 +- .../Controllers/HomeController.cs | 11 + .../Learun.Application.Web.csproj | 5 + .../Sys_DefaultPwdConfigMap.cs | 29 +++ .../Learun.Application.Mapping.csproj | 1 + .../EmpInfo/EmpInfoService.cs | 9 +- .../StuInfoBasic/StuInfoBasicService.cs | 9 +- .../StuInfoFresh/StuInfoFreshService.cs | 9 +- .../Sys_DefaultPwdConfigBLL.cs | 171 ++++++++++++++ .../Sys_DefaultPwdConfigEntity.cs | 60 +++++ .../Sys_DefaultPwdConfigIBLL.cs | 61 +++++ .../Sys_DefaultPwdConfigService.cs | 213 ++++++++++++++++++ .../Learun.Application.TwoDevelopment.csproj | 4 + 20 files changed, 952 insertions(+), 12 deletions(-) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Sys_DefaultPwdConfigController.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_DefaultPwdConfig/Form.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_DefaultPwdConfig/Form.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_DefaultPwdConfig/Index.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_DefaultPwdConfig/Index.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/Sys_DefaultPwdConfigMap.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Sys_DefaultPwdConfig/Sys_DefaultPwdConfigBLL.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Sys_DefaultPwdConfig/Sys_DefaultPwdConfigEntity.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Sys_DefaultPwdConfig/Sys_DefaultPwdConfigIBLL.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Sys_DefaultPwdConfig/Sys_DefaultPwdConfigService.cs diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserBLL.cs b/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserBLL.cs index d86188c5b..d7ee5a89f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserBLL.cs @@ -857,7 +857,7 @@ namespace Learun.Application.Organization /// 重置密码 /// /// 账号主键 - public void ResetPassword(string keyValue) + public void ResetPassword(string keyValue, string defaultpwd) { try { @@ -871,7 +871,7 @@ namespace Learun.Application.Organization { cache.Remove(cacheKeyId + item, CacheId.user); } - string password = Md5Helper.Encrypt(ConfigurationManager.AppSettings["defaultpwd"], 32).ToLower(); + string password = Md5Helper.Encrypt(defaultpwd, 32).ToLower(); userService.RevisePasswordBatch(keyValue, password); } catch (Exception ex) @@ -908,7 +908,7 @@ namespace Learun.Application.Organization /// 重置密码(八位) /// /// 账号主键 - public void ResetPasswordEight(string keyValue) + public void ResetPasswordEight(string keyValue, string defaultpwd) { try { @@ -916,7 +916,7 @@ namespace Learun.Application.Organization { cache.Remove(cacheKeyId + item, CacheId.user); } - string password = Md5Helper.Encrypt(ConfigurationManager.AppSettings["defaultpwdeight"], 32).ToLower(); + string password = Md5Helper.Encrypt(defaultpwd, 32).ToLower(); userService.RevisePasswordBatch(keyValue, password); } catch (Exception ex) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserIBLL.cs index d3638ade7..105763e06 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserIBLL.cs @@ -130,12 +130,12 @@ namespace Learun.Application.Organization /// 重置密码 /// /// 账号主键 - void ResetPassword(string keyValue); + void ResetPassword(string keyValue, string defaultpwd); /// /// 重置密码(八位) /// /// 账号主键 - void ResetPasswordEight(string keyValue); + void ResetPasswordEight(string keyValue, string defaultpwd); /// /// 修改用户状态 /// @@ -179,7 +179,7 @@ namespace Learun.Application.Organization /// 用户ID void GetImg(string userId); - void setPassword(string userid,string pwd); + void setPassword(string userid, string pwd); List GetStudents(); #endregion diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Sys_DefaultPwdConfigController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Sys_DefaultPwdConfigController.cs new file mode 100644 index 000000000..06bc4449f --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Sys_DefaultPwdConfigController.cs @@ -0,0 +1,131 @@ +using Learun.Util; +using System.Data; +using Learun.Application.TwoDevelopment.EducationalAdministration; +using System.Web.Mvc; +using System.Collections.Generic; + +namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-01-19 11:14 + /// 描 述:默认密码配置 + /// + public class Sys_DefaultPwdConfigController : MvcControllerBase + { + private Sys_DefaultPwdConfigIBLL sys_DefaultPwdConfigIBLL = new Sys_DefaultPwdConfigBLL(); + + #region 视图功能 + + /// + /// 主页面 + /// + /// + [HttpGet] + public ActionResult Index() + { + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult Form() + { + return View(); + } + #endregion + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = sys_DefaultPwdConfigIBLL.GetPageList(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + /// + /// 获取表单数据 + /// + /// 主键 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetFormData(string keyValue) + { + var Sys_DefaultPwdConfigData = sys_DefaultPwdConfigIBLL.GetSys_DefaultPwdConfigEntity( keyValue ); + var jsonData = new { + Sys_DefaultPwdConfig = Sys_DefaultPwdConfigData, + }; + return Success(jsonData); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + sys_DefaultPwdConfigIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue, string strEntity) + { + Sys_DefaultPwdConfigEntity entity = strEntity.ToObject(); + entity.IsEnabled = false; + sys_DefaultPwdConfigIBLL.SaveEntity(keyValue,entity); + if (string.IsNullOrEmpty(keyValue)) + { + } + return Success("保存成功!"); + } + + /// + /// 启用 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DoEnabled(string keyValue) + { + sys_DefaultPwdConfigIBLL.DoEnabled(keyValue); + return Success("操作成功!"); + } + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_DefaultPwdConfig/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_DefaultPwdConfig/Form.cshtml new file mode 100644 index 000000000..cabfef4e5 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_DefaultPwdConfig/Form.cshtml @@ -0,0 +1,15 @@ +@{ + ViewBag.Title = "默认密码配置"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
密码名称*
+ +
+
+
密码*
+ +
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/Sys_DefaultPwdConfig/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_DefaultPwdConfig/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_DefaultPwdConfig/Form.js new file mode 100644 index 000000000..83feddc3b --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_DefaultPwdConfig/Form.js @@ -0,0 +1,51 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-01-19 11:14 + * 描 述:默认密码配置 + */ +var acceptClick; +var keyValue = request('keyValue'); +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + page.initData(); + }, + bind: function () { + + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/Sys_DefaultPwdConfig/GetFormData?keyValue=' + keyValue, function (data) { + for (var id in data) { + if (!!data[id].length && data[id].length > 0) { + $('#' + id ).jfGridSet('refreshdata', data[id]); + } + else { + $('[data-table="' + id + '"]').lrSetFormData(data[id]); + } + } + }); + } + } + }; + // 保存数据 + acceptClick = function (callBack) { + if (!$('body').lrValidform()) { + return false; + } + var postData = { + strEntity: JSON.stringify($('body').lrGetFormData()) + }; + $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/Sys_DefaultPwdConfig/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_DefaultPwdConfig/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_DefaultPwdConfig/Index.cshtml new file mode 100644 index 000000000..eb3bddb53 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_DefaultPwdConfig/Index.cshtml @@ -0,0 +1,39 @@ +@{ + ViewBag.Title = "默认密码配置"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
密码名称
+ +
+
+
+
+
+
+
+ +
+ +
+  启用 +
+
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/Sys_DefaultPwdConfig/Index.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_DefaultPwdConfig/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_DefaultPwdConfig/Index.js new file mode 100644 index 000000000..9c43797f2 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Sys_DefaultPwdConfig/Index.js @@ -0,0 +1,112 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-01-19 11:14 + * 描 述:默认密码配置 + */ +var refreshGirdData; +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.initGird(); + page.bind(); + }, + bind: function () { + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 220, 400); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 新增 + $('#lr_add').on('click', function () { + learun.layerForm({ + id: 'form', + title: '新增', + url: top.$.rootUrl + '/EducationalAdministration/Sys_DefaultPwdConfig/Form', + width: 600, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); + // 编辑 + $('#lr_edit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'form', + title: '编辑', + url: top.$.rootUrl + '/EducationalAdministration/Sys_DefaultPwdConfig/Form?keyValue=' + keyValue, + width: 600, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + // 删除 + $('#lr_delete').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认删除该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/Sys_DefaultPwdConfig/DeleteForm', { keyValue: keyValue}, function () { + refreshGirdData(); + }); + } + }); + } + }); + // 启用 + $('#lr_enabled').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + var IsEnabled = $('#gridtable').jfGridValue('IsEnabled'); + if (IsEnabled == true) { + learun.alert.warning("当前项已启用!"); + return false; + } + learun.layerConfirm('是否确认启用该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/Sys_DefaultPwdConfig/DoEnabled', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').lrAuthorizeJfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/Sys_DefaultPwdConfig/GetPageList', + headData: [ + { label: "密码名称", name: "PwdName", width: 150, align: "left"}, + { label: "密码", name: "Pwd", width: 150, align: "left"}, + { + label: "是否启用", name: "IsEnabled", width: 100, align: "left", + formatter: function (cellvalue, rowObject) { + return cellvalue == true ? "" : ""; + } + }, + ], + mainId:'Id', + isPage: true + }); + page.search(); + }, + search: function (param) { + param = param || {}; + $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + $('#gridtable').jfGridSet('reload'); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Controllers/UserController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Controllers/UserController.cs index cdbd2adc1..e11189411 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Controllers/UserController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Controllers/UserController.cs @@ -6,6 +6,8 @@ using Learun.Application.Base.AuthorizeModule; using System.Linq; using System; using Learun.Application.Base.SystemModule; +using Learun.Application.TwoDevelopment.EducationalAdministration; +using System.Configuration; namespace Learun.Application.Web.Areas.LR_OrganizationModule.Controllers { @@ -23,6 +25,8 @@ namespace Learun.Application.Web.Areas.LR_OrganizationModule.Controllers private UserRelationIBLL userRelationIBLL = new UserRelationBLL(); private RoleIBLL roleIBLL = new RoleBLL(); + private Sys_DefaultPwdConfigIBLL sys_DefaultPwdConfigIBLL = new Sys_DefaultPwdConfigBLL(); + #region 获取视图 @@ -334,7 +338,13 @@ namespace Learun.Application.Web.Areas.LR_OrganizationModule.Controllers [AjaxOnly] public ActionResult ResetPassword(string keyValue) { - userIBLL.ResetPassword(keyValue); + string defpwd = ConfigurationManager.AppSettings["defaultpwd"]; + //读取默认密码配置中已启用的密码 + if (sys_DefaultPwdConfigIBLL.GetEnabledEntity() != null) + { + defpwd = sys_DefaultPwdConfigIBLL.GetEnabledEntity().Pwd; + } + userIBLL.ResetPassword(keyValue, defpwd); return Success("操作成功!"); } /// @@ -346,7 +356,13 @@ namespace Learun.Application.Web.Areas.LR_OrganizationModule.Controllers [AjaxOnly] public ActionResult ResetPasswordEight(string keyValue) { - userIBLL.ResetPasswordEight(keyValue); + string defpwd = ConfigurationManager.AppSettings["defaultpwdeight"]; + //读取默认密码配置中已启用的密码 + if (sys_DefaultPwdConfigIBLL.GetEnabledEntity() != null) + { + defpwd = sys_DefaultPwdConfigIBLL.GetEnabledEntity().Pwd; + } + userIBLL.ResetPasswordEight(keyValue, defpwd); return Success("操作成功!"); } 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 3a789cc9e..ec64e555f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/HomeController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/HomeController.cs @@ -57,6 +57,7 @@ namespace Learun.Application.Web.Controllers private Sys_UpdateRecordIBLL sys_UpdateRecordIBLL = new Sys_UpdateRecordBLL(); private Perm_FunctionIBLL perm_FunctionIBLL = new Perm_FunctionBLL(); private ICache redisCache = CacheFactory.CaChe(); + private Sys_DefaultPwdConfigIBLL sys_DefaultPwdConfigIBLL = new Sys_DefaultPwdConfigBLL(); #region 视图功能 public ActionResult ChangePwd() @@ -229,6 +230,11 @@ namespace Learun.Application.Web.Controllers string qingJuurl = ConfigurationManager.AppSettings["QingJuurl"]; string qingjuregisterurl = ConfigurationManager.AppSettings["QingJuRegisterurl"]; string defpwd = ConfigurationManager.AppSettings["defaultpwd"]; + //读取默认密码配置中已启用的密码 + if (sys_DefaultPwdConfigIBLL.GetEnabledEntity() != null) + { + defpwd = sys_DefaultPwdConfigIBLL.GetEnabledEntity().Pwd; + } var qjinfo = qjAccountIbll.GetQingJu_UserAccountEntityByAccount(userinfo.account); if (qjinfo == null || string.IsNullOrEmpty(qjinfo.UserAccount)) { @@ -335,6 +341,11 @@ namespace Learun.Application.Web.Controllers string qingJuurl = ConfigurationManager.AppSettings["QingJuurl"]; string qingjuregisterurl = ConfigurationManager.AppSettings["QingJuRegisterurl"]; string defpwd = ConfigurationManager.AppSettings["defaultpwd"]; + //读取默认密码配置中已启用的密码 + if (sys_DefaultPwdConfigIBLL.GetEnabledEntity() != null) + { + defpwd = sys_DefaultPwdConfigIBLL.GetEnabledEntity().Pwd; + } if (up != null && !string.IsNullOrEmpty(up.QUserName)) { if (userinfo.Description == "教师") 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 5c0c2a9c5..ec78642d6 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 @@ -792,6 +792,7 @@ + @@ -6124,6 +6125,10 @@ + + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/Sys_DefaultPwdConfigMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/Sys_DefaultPwdConfigMap.cs new file mode 100644 index 000000000..7fb01847f --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/Sys_DefaultPwdConfigMap.cs @@ -0,0 +1,29 @@ +using Learun.Application.TwoDevelopment.EducationalAdministration; +using System.Data.Entity.ModelConfiguration; + +namespace Learun.Application.Mapping +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-01-19 11:14 + /// 描 述:默认密码配置 + /// + public class Sys_DefaultPwdConfigMap : EntityTypeConfiguration + { + public Sys_DefaultPwdConfigMap() + { + #region 表、主键 + //表 + this.ToTable("SYS_DEFAULTPWDCONFIG"); + //主键 + this.HasKey(t => t.Id); + #endregion + + #region 配置关系 + #endregion + } + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj index e6b2f1fa7..57ae14407 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj @@ -544,6 +544,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EmpInfo/EmpInfoService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EmpInfo/EmpInfoService.cs index f339b20ff..3cdd425ec 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EmpInfo/EmpInfoService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EmpInfo/EmpInfoService.cs @@ -336,6 +336,13 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration UserIBLL userIBLL = new UserBLL(); var alluserlist = userIBLL.GetAllList().Where(m => m.F_Description == "教师"); var roleId = Config.GetValue("GenerateTeachersRoleId"); + var defaultpwd = Config.GetValue("defaultpwd"); + //读取默认密码配置中已启用的密码 + var Sys_DefaultPwdConfigEntity = this.BaseRepository().FindEntity(x => x.IsEnabled == true); + if (Sys_DefaultPwdConfigEntity != null) + { + defaultpwd = Sys_DefaultPwdConfigEntity.Pwd; + } var studentList = new List(); foreach (var tEntity in teacherList) { @@ -355,7 +362,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration userbase.F_Account = tEntity.EmpNo; userbase.F_RealName = tEntity.EmpName; userbase.F_EnCode = tEntity.EmpNo; - userbase.F_Password = Md5Helper.Encrypt(Config.GetValue("defaultpwd"), 32).ToLower(); + userbase.F_Password = Md5Helper.Encrypt(defaultpwd, 32).ToLower(); userbase.F_HeadIcon = string.IsNullOrEmpty(url) ? Config.GetValue("defaultheadimg") : url; userbase.F_Gender = tEntity.GenderNo.HasValue ? Convert.ToInt32(tEntity.GenderNo.Value) : 1; userbase.F_DeleteMark = 0; diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicService.cs index a1dc54122..a31760d11 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicService.cs @@ -715,6 +715,13 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration var stuInfoBasicEntities = BaseRepository("CollegeMIS").FindList(m => m.CheckMark != "0"); var alluserlist = userIBLL.GetAllList().Where(m => m.F_Description == "学生"); var roleId = Config.GetValue("GenerateStudentsRoleId"); + var defaultpwd = Config.GetValue("defaultpwd"); + //读取默认密码配置中已启用的密码 + var Sys_DefaultPwdConfigEntity = this.BaseRepository().FindEntity(x => x.IsEnabled == true); + if (Sys_DefaultPwdConfigEntity != null) + { + defaultpwd = Sys_DefaultPwdConfigEntity.Pwd; + } var studentList = new List(); foreach (var tEntity in stuInfoBasicEntities) { @@ -736,7 +743,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration userbase.F_Account = tEntity.StuNo; userbase.F_RealName = tEntity.StuName; userbase.F_EnCode = tEntity.StuNo; - userbase.F_Password = Md5Helper.Encrypt(Config.GetValue("defaultpwd"), 32).ToLower(); + userbase.F_Password = Md5Helper.Encrypt(defaultpwd, 32).ToLower(); userbase.F_HeadIcon = string.IsNullOrEmpty(url) ? Config.GetValue("defaultheadimg") : url; userbase.F_Gender = tEntity.GenderNo.HasValue ? Convert.ToInt32(tEntity.GenderNo.Value) : 1; userbase.F_DeleteMark = 0; diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoFresh/StuInfoFreshService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoFresh/StuInfoFreshService.cs index 20ec72cce..187bde2fb 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoFresh/StuInfoFreshService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoFresh/StuInfoFreshService.cs @@ -1178,6 +1178,13 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { UserRelationIBLL userRelationIBLL = new UserRelationBLL(); UserIBLL userIBLL = new UserBLL(); + var defaultpwd = Config.GetValue("defaultpwd"); + //读取默认密码配置中已启用的密码 + var Sys_DefaultPwdConfigEntity = this.BaseRepository().FindEntity(x => x.IsEnabled == true); + if (Sys_DefaultPwdConfigEntity != null) + { + defaultpwd = Sys_DefaultPwdConfigEntity.Pwd; + } var db = this.BaseRepository("CollegeMIS").BeginTrans(); try @@ -1207,7 +1214,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration F_Account = entity.StuNo, F_RealName = entity.StuName, F_EnCode = entity.StuNo, - F_Password = Md5Helper.Encrypt(Config.GetValue("defaultpwd"), 32).ToLower(), + F_Password = Md5Helper.Encrypt(defaultpwd, 32).ToLower(), F_HeadIcon = string.IsNullOrEmpty(url) ? Config.GetValue("defaultheadimg") : url, F_Gender = entity.GenderNo == "1" ? 1 : 0, F_DeleteMark = 0, diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Sys_DefaultPwdConfig/Sys_DefaultPwdConfigBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Sys_DefaultPwdConfig/Sys_DefaultPwdConfigBLL.cs new file mode 100644 index 000000000..1f48c7da4 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Sys_DefaultPwdConfig/Sys_DefaultPwdConfigBLL.cs @@ -0,0 +1,171 @@ +using Learun.Util; +using System; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-01-19 11:14 + /// 描 述:默认密码配置 + /// + public class Sys_DefaultPwdConfigBLL : Sys_DefaultPwdConfigIBLL + { + private Sys_DefaultPwdConfigService sys_DefaultPwdConfigService = new Sys_DefaultPwdConfigService(); + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + return sys_DefaultPwdConfigService.GetPageList(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取Sys_DefaultPwdConfig表实体数据 + /// + /// 主键 + /// + public Sys_DefaultPwdConfigEntity GetSys_DefaultPwdConfigEntity(string keyValue) + { + try + { + return sys_DefaultPwdConfigService.GetSys_DefaultPwdConfigEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取Sys_DefaultPwdConfig表实体数据 + /// + /// 主键 + /// + public Sys_DefaultPwdConfigEntity GetEnabledEntity() + { + try + { + return sys_DefaultPwdConfigService.GetEnabledEntity(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + try + { + sys_DefaultPwdConfigService.DeleteEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + public void SaveEntity(string keyValue, Sys_DefaultPwdConfigEntity entity) + { + try + { + sys_DefaultPwdConfigService.SaveEntity(keyValue, entity); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 启用 + /// + /// 主键 + public void DoEnabled(string keyValue) + { + try + { + sys_DefaultPwdConfigService.DoEnabled(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Sys_DefaultPwdConfig/Sys_DefaultPwdConfigEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Sys_DefaultPwdConfig/Sys_DefaultPwdConfigEntity.cs new file mode 100644 index 000000000..26c6b516f --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Sys_DefaultPwdConfig/Sys_DefaultPwdConfigEntity.cs @@ -0,0 +1,60 @@ +using Learun.Util; +using System; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-01-19 11:14 + /// 描 述:默认密码配置 + /// + public class Sys_DefaultPwdConfigEntity + { + #region 实体成员 + /// + /// Id + /// + [Column("ID")] + public string Id { get; set; } + /// + /// PwdName + /// + [Column("PWDNAME")] + public string PwdName { get; set; } + /// + /// Pwd + /// + [Column("PWD")] + public string Pwd { get; set; } + /// + /// IsEnabled + /// + [Column("ISENABLED")] + public bool? IsEnabled { get; set; } + #endregion + + #region 扩展操作 + /// + /// 新增调用 + /// + public void Create() + { + this.Id = Guid.NewGuid().ToString(); + } + /// + /// 编辑调用 + /// + /// + public void Modify(string keyValue) + { + this.Id = keyValue; + } + #endregion + #region 扩展字段 + #endregion + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Sys_DefaultPwdConfig/Sys_DefaultPwdConfigIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Sys_DefaultPwdConfig/Sys_DefaultPwdConfigIBLL.cs new file mode 100644 index 000000000..59108bee8 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Sys_DefaultPwdConfig/Sys_DefaultPwdConfigIBLL.cs @@ -0,0 +1,61 @@ +using Learun.Util; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-01-19 11:14 + /// 描 述:默认密码配置 + /// + public interface Sys_DefaultPwdConfigIBLL + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + IEnumerable GetPageList(Pagination pagination, string queryJson); + /// + /// 获取Sys_DefaultPwdConfig表实体数据 + /// + /// 主键 + /// + Sys_DefaultPwdConfigEntity GetSys_DefaultPwdConfigEntity(string keyValue); + + /// + /// 获取Sys_DefaultPwdConfig表实体数据 + /// + /// 主键 + /// + Sys_DefaultPwdConfigEntity GetEnabledEntity(); + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + void DeleteEntity(string keyValue); + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + void SaveEntity(string keyValue, Sys_DefaultPwdConfigEntity entity); + + /// + /// 启用 + /// + /// 主键 + void DoEnabled(string keyValue); + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Sys_DefaultPwdConfig/Sys_DefaultPwdConfigService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Sys_DefaultPwdConfig/Sys_DefaultPwdConfigService.cs new file mode 100644 index 000000000..691dedf18 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Sys_DefaultPwdConfig/Sys_DefaultPwdConfigService.cs @@ -0,0 +1,213 @@ +using Dapper; +using Learun.DataBase.Repository; +using Learun.Util; +using System; +using System.Collections.Generic; +using System.Data; +using System.Text; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-01-19 11:14 + /// 描 述:默认密码配置 + /// + public class Sys_DefaultPwdConfigService : RepositoryFactory + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(@" + t.Id, + t.PwdName, + t.Pwd, + t.IsEnabled + "); + strSql.Append(" FROM Sys_DefaultPwdConfig t "); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["PwdName"].IsEmpty()) + { + dp.Add("PwdName", "%" + queryParam["PwdName"].ToString() + "%", DbType.String); + strSql.Append(" AND t.PwdName Like @PwdName "); + } + return this.BaseRepository().FindList(strSql.ToString(), dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取Sys_DefaultPwdConfig表实体数据 + /// + /// 主键 + /// + public Sys_DefaultPwdConfigEntity GetSys_DefaultPwdConfigEntity(string keyValue) + { + try + { + return this.BaseRepository().FindEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取Sys_DefaultPwdConfig表实体数据 + /// + /// 主键 + /// + public Sys_DefaultPwdConfigEntity GetEnabledEntity() + { + try + { + return this.BaseRepository().FindEntity(x => x.IsEnabled == true); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + try + { + this.BaseRepository().Delete(t => t.Id == keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + public void SaveEntity(string keyValue, Sys_DefaultPwdConfigEntity entity) + { + try + { + if (!string.IsNullOrEmpty(keyValue)) + { + entity.Modify(keyValue); + this.BaseRepository().Update(entity); + } + else + { + entity.Create(); + this.BaseRepository().Insert(entity); + } + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 启用 + /// + /// 主键 + public void DoEnabled(string keyValue) + { + var db = this.BaseRepository().BeginTrans(); + try + { + var model = this.BaseRepository().FindEntity(x => x.IsEnabled == true); + if (model != null) + { + model.IsEnabled = false; + db.Update(model); + } + var newmodel = this.BaseRepository().FindEntity(x => x.Id == keyValue); + if (newmodel != null) + { + newmodel.IsEnabled = true; + db.Update(newmodel); + } + + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj index 22a49063c..65a22902b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj @@ -1597,6 +1597,10 @@ + + + + From 9e4fe11c0ff619b773114fe88c17c50afc03bd31 Mon Sep 17 00:00:00 2001 From: liangkun Date: Tue, 19 Jan 2021 16:23:13 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E9=BB=98=E8=AE=A4=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7=E5=8F=96=E6=B6=88=E5=BC=B9=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Learun.Application.Web/Views/Login/Default.cshtml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/Default.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/Default.cshtml index ddb0c4cb8..72179e6e4 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/Default.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/Default.cshtml @@ -172,7 +172,7 @@ @Html.AppendJsFile("/Views/Login/Default/Index.js") @Html.AppendJsFile("/Views/Login/ACLogon.js") - + *@ \ No newline at end of file From 340dff40f818f19add04c02ed28b31358359e556 Mon Sep 17 00:00:00 2001 From: dyy <18335927079@163.com> Date: Tue, 19 Jan 2021 17:11:05 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E9=A1=B5=E7=82=B9=E5=87=BB=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7=E4=B8=8D=E6=98=BE=E7=A4=BA=E7=89=88=E6=9C=AC=E5=8E=86?= =?UTF-8?q?=E7=A8=8B=E5=BC=B9=E6=A1=86=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Views/Login/DefaultWxLogin.cshtml | 19 ------------------ .../Views/Login/PageFive.cshtml | 6 +++--- .../Views/Login/PageFiveWxLogin.cshtml | 18 ----------------- .../Views/Login/PageFour.cshtml | 4 ++-- .../Views/Login/PageFourWxLogin.cshtml | 18 ----------------- .../Views/Login/PageOne.cshtml | 4 ++-- .../Views/Login/PageOneWxLogin.cshtml | 18 ----------------- .../Views/Login/PageSix.cshtml | 13 +++++++----- .../Views/Login/PageSixWxLogin.cshtml | 20 +------------------ .../Views/Login/PageThree.cshtml | 4 ++-- .../Views/Login/PageThreeWxLogin.cshtml | 18 ----------------- .../Views/Login/PageTwo.cshtml | 4 ++-- .../Views/Login/PageTwoWxLogin.cshtml | 18 ----------------- 13 files changed, 20 insertions(+), 144 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/DefaultWxLogin.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/DefaultWxLogin.cshtml index 201ddd865..cf8e3d780 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/DefaultWxLogin.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/DefaultWxLogin.cshtml @@ -159,24 +159,5 @@ @Html.AppendJsFile("/Views/Login/Default/IndexWxLogin.js") @Html.AppendJsFile("/Views/Login/ACLogon.js") - \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageFive.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageFive.cshtml index c316daec3..35c262a25 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageFive.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageFive.cshtml @@ -148,9 +148,9 @@ @Html.AppendJsFile("/Views/Login/PageFive/Index.js") @Html.AppendJsFile("/Views/Login/ACLogon.js") - +*@ diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageFiveWxLogin.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageFiveWxLogin.cshtml index babca3db7..7540aafb7 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageFiveWxLogin.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageFiveWxLogin.cshtml @@ -136,24 +136,6 @@ @Html.AppendJsFile("/Views/Login/PageFive/IndexWxLogin.js") @Html.AppendJsFile("/Views/Login/ACLogon.js") - diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageFour.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageFour.cshtml index 754a2999a..d99c081c1 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageFour.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageFour.cshtml @@ -148,7 +148,7 @@ @Html.AppendJsFile("/Views/Login/PageFour/Index.js") @Html.AppendJsFile("/Views/Login/ACLogon.js") - +*@ diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageFourWxLogin.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageFourWxLogin.cshtml index 1ae339f7a..4a583626e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageFourWxLogin.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageFourWxLogin.cshtml @@ -129,23 +129,5 @@ @Html.AppendJsFile("/Views/Login/PageFour/IndexWxLogin.js") @Html.AppendJsFile("/Views/Login/ACLogon.js") - diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageOne.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageOne.cshtml index e55094774..4cad4fb0e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageOne.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageOne.cshtml @@ -142,7 +142,7 @@ @Html.AppendJsFile("/Views/Login/PageOne/Index.js") @Html.AppendJsFile("/Views/Login/ACLogon.js") - +*@ diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageOneWxLogin.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageOneWxLogin.cshtml index d07d2ccfa..e324dc89b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageOneWxLogin.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageOneWxLogin.cshtml @@ -132,24 +132,6 @@ @Html.AppendJsFile("/Views/Login/PageOne/IndexWxLogin.js") @Html.AppendJsFile("/Views/Login/ACLogon.js") - diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageSix.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageSix.cshtml index 56b674a94..2f85fc74e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageSix.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageSix.cshtml @@ -14,6 +14,7 @@ + @@ -94,10 +95,12 @@
- 版本号 : @if (ViewBag.Version) + + 版本号 : @if (ViewBag.Version) { - @ViewBag.errornum - }       在线用户人数 : @ViewBag.OnlineUserNum 人 + @ViewBag.VersionNum + } +       在线用户人数 : @ViewBag.OnlineUserNum 人
北京金隅科技学校       智慧校园 版权所有
@@ -139,7 +142,7 @@ @Html.AppendJsFile("/Views/Login/PageSix/Index.js") @Html.AppendJsFile("/Views/Login/ACLogon.js") - + *@ diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageSixWxLogin.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageSixWxLogin.cshtml index 0609255fa..7fc04c9d6 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageSixWxLogin.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageSixWxLogin.cshtml @@ -126,25 +126,7 @@ @Html.AppendJsFile("/Views/Login/PageSix/IndexWxLogin.js") @Html.AppendJsFile("/Views/Login/ACLogon.js") - + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageThree.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageThree.cshtml index bac01beb2..c7c879004 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageThree.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageThree.cshtml @@ -153,7 +153,7 @@ @Html.AppendJsFile("/Views/Login/PageThree/Index.js") @Html.AppendJsFile("/Views/Login/ACLogon.js") - +*@ diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageThreeWxLogin.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageThreeWxLogin.cshtml index 6e25e93b0..c7abbca1b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageThreeWxLogin.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageThreeWxLogin.cshtml @@ -129,24 +129,6 @@ @Html.AppendJsFile("/Views/Login/PageThree/IndexWxLogin.js") @Html.AppendJsFile("/Views/Login/ACLogon.js") - diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageTwo.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageTwo.cshtml index c4d5e9914..2f8c7ad2e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageTwo.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageTwo.cshtml @@ -139,7 +139,7 @@ @Html.AppendJsFile("/Views/Login/PageTwo/Index.js") @Html.AppendJsFile("/Views/Login/ACLogon.js") - +*@ diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageTwoWxLogin.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageTwoWxLogin.cshtml index a1d3c3f4e..77944ab03 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageTwoWxLogin.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/PageTwoWxLogin.cshtml @@ -127,24 +127,6 @@ @Html.AppendJsFile("/Views/Login/PageTwo/IndexWxLogin.js") @Html.AppendJsFile("/Views/Login/ACLogon.js") - From 0fb2346fcde2cadc6a282c54417ca001d38e8113 Mon Sep 17 00:00:00 2001 From: dyy <18335927079@163.com> Date: Thu, 21 Jan 2021 18:08:54 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=AF=86=E7=A0=81=E6=8F=90=E7=A4=BA=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=EF=BC=9B=E7=99=BB=E5=BD=95=E6=AC=A1=E6=95=B0=E9=99=90?= =?UTF-8?q?=E5=88=B6=E5=8A=9F=E8=83=BD=EF=BC=9B=E7=A6=81=E6=AD=A2=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E6=97=B6=E9=97=B4=E9=99=90=E5=88=B6=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../User/UserBLL.cs | 25 +++++++ .../User/UserIBLL.cs | 7 ++ .../User/UserService.cs | 32 +++++++++ .../Controllers/LoginController.cs | 65 +++++++++++++++++-- .../Views/Home/AdminDefault/index.js | 11 +++- .../Views/Login/Default.cshtml | 52 ++++++++------- .../Views/Login/Default/Index.js | 27 ++++++-- .../XmlConfig/system.config | 4 ++ 8 files changed, 186 insertions(+), 37 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserBLL.cs b/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserBLL.cs index d7ee5a89f..28166cfc8 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserBLL.cs @@ -1201,6 +1201,31 @@ namespace Learun.Application.Organization } } + + /// + /// 修改用户的允许登录结束时间 + /// + /// 主键值 + /// 状态:1-赋值;0-重置 + public void UpdateAllowEndTime(string keyValue, int state) + { + try + { + userService.UpdateAllowEndTime(keyValue, state); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + ///// ///// 获取用户头像 ///// diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserIBLL.cs index 105763e06..fe666353f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserIBLL.cs @@ -195,5 +195,12 @@ namespace Learun.Application.Organization void UpdateIp(string ip, string id); void GetImgForDC(string userId); UserEntity GetEntityByWeixinOpenIdPC(string openId); + + /// + /// 修改用户的允许登录结束时间 + /// + /// 主键值 + /// 状态:1-赋值;0-重置 + void UpdateAllowEndTime(string keyValue, int state); } } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserService.cs b/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserService.cs index c3bd4ab11..12f3ce4bc 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserService.cs @@ -848,6 +848,38 @@ namespace Learun.Application.Organization } } } + + /// + /// 修改用户的允许登录结束时间 + /// + /// 主键值 + /// 状态:1-赋值;0-重置 + public void UpdateAllowEndTime(string keyValue, int state) + { + try + { + if (state == 0) + { + this.BaseRepository().ExecuteBySql("update LR_Base_User set F_AllowEndTime=null where F_UserId='" + keyValue + "'"); + } + else + { + this.BaseRepository().ExecuteBySql("update LR_Base_User set F_AllowEndTime='" + DateTime.Now + "' where F_UserId='" + keyValue + "'"); + } + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + } } 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 58f0e81e4..32fd91b1c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/LoginController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/LoginController.cs @@ -38,6 +38,7 @@ namespace Learun.Application.Web.Controllers private LoginModelIBLL loginModelIbll = new LoginModelBLL(); private AnnexesFileIBLL annexesFileIbll = new AnnexesFileBLL(); WeChatDevelopIBLL weChatDevelopIbll = new WeChatDevelopBLL(); + private Sys_DefaultPwdConfigIBLL sys_DefaultPwdConfigIBLL = new Sys_DefaultPwdConfigBLL(); #endregion #region 视图功能 @@ -184,6 +185,15 @@ namespace Learun.Application.Web.Controllers } //获取错误次数 ViewBag.errornum = OperatorHelper.Instance.GetCurrentErrorNum(); + //获取初始密码设置中已启用的密码 + ViewBag.IsSetDefaultPwd = false; + ViewBag.DefaultPwd = ""; + var defaultPwdEntity = sys_DefaultPwdConfigIBLL.GetEnabledEntity(); + if (defaultPwdEntity != null) + { + ViewBag.IsSetDefaultPwd = true; + ViewBag.DefaultPwd = defaultPwdEntity.Pwd; + } //获取高职版跳转地址 ViewBag.DigitalschoolMisLoginurl = ConfigurationManager.AppSettings["DigitalschoolMisLoginurl"]; ViewBag.Returnurl = "http://" + Request.Url.Host + ":" + Request.Url.Port; @@ -499,11 +509,13 @@ namespace Learun.Application.Web.Controllers /// 用户名 /// 密码 /// 验证码 + /// 密码是否是强密码 + /// 密码是否是初始密码,是则需要提示(true) /// [HttpPost] [AjaxOnly] [HandlerValidateAntiForgeryToken] - public ActionResult CheckLogin(string username, string password, string verifycode, string up) + public ActionResult CheckLogin(string username, string password, string verifycode, string up, string defaultPwdTip) { int error = OperatorHelper.Instance.GetCurrentErrorNum(); @@ -521,6 +533,41 @@ namespace Learun.Application.Web.Controllers #region 内部账户验证 UserEntity userEntity = userBll.CheckLogin(username, password); + #region 登录次数限制,禁止登录时间限制 + int defaultForbidLoginNum = 5;//默认的禁止登录次数 + double defaultForbidLoginMinutes = 10;//默认的禁止登录分钟数 + if (!string.IsNullOrEmpty(Config.GetValue("ForbidLoginNum"))) + { + defaultForbidLoginNum = Config.GetValue("ForbidLoginNum").ToInt(); + } + if (!string.IsNullOrEmpty(Config.GetValue("ForbidLoginMinutes"))) + { + defaultForbidLoginMinutes = Config.GetValue("ForbidLoginMinutes").ToDouble(); + } + //错误次数大于等于5时,判断禁止登录时间是否超过10分钟:若是则修改用户的允许登录结束时间,可以登录;若否,禁止登录; + if (error >= defaultForbidLoginNum) + { + if (userEntity.LoginOk)//登录成功 + { + if (userEntity.F_AllowEndTime.HasValue) + { + var period = (DateTime.Now - userEntity.F_AllowEndTime.Value).TotalMinutes; + if (period >= defaultForbidLoginMinutes) + { + userBll.UpdateAllowEndTime(userEntity.F_UserId, 0); + } + else + { + return Fail("错误次数超过" + defaultForbidLoginNum + "次,已被禁止登录,请" + defaultForbidLoginMinutes + "分钟后重试!", error); + } + } + } + else//登录失败 + { + return Fail(userEntity.LoginMsg, error); + } + } + #endregion #region 写入日志 LogEntity logEntity = new LogEntity(); @@ -540,6 +587,11 @@ namespace Learun.Application.Web.Controllers logEntity.F_ExecuteResultJson = "登录失败:" + userEntity.LoginMsg; logEntity.WriteLog(); int num = OperatorHelper.Instance.AddCurrentErrorNum(); + //判断登录错误次数大于等于5,修改用户的允许登录结束时间; + if (num >= defaultForbidLoginNum) + { + userBll.UpdateAllowEndTime(userEntity.F_UserId, 1); + } return Fail(userEntity.LoginMsg, num); } else @@ -552,12 +604,15 @@ namespace Learun.Application.Web.Controllers logEntity.F_ExecuteResultJson = "登录成功"; logEntity.WriteLog(); OperatorHelper.Instance.ClearCurrentErrorNum(); + //修改用户的允许登录结束时间; + userBll.UpdateAllowEndTime(userEntity.F_UserId, 0); //是否强密码验证 if (!string.IsNullOrEmpty(ConfigurationManager.AppSettings["verifypwd"]) && ConfigurationManager.AppSettings["verifypwd"] == "true" && up == "false") { - return Success(new { pwd = true }); + return Success(new { pwd = true, pwdtip = defaultPwdTip == "true" ? true : false }); } - return Success("登录成功"); + //返回成功的数据(pwdtip:初始密码提示弹框;pwd:弱密码修改弹框;) + return Success("登录成功", new { pwdtip = defaultPwdTip == "true" ? true : false }); } #endregion } @@ -899,8 +954,8 @@ namespace Learun.Application.Web.Controllers { string appid = "76d40062-349f-486d-b871-35bed08d2f59"; string secret = "cgpi"; - string appkey =Request.QueryString["appkey"]; - string response = Util.HttpMethods.HttpGet("http://localhost:20472/SSOSystem/authorize?appid=" + appid + "&secret=" + secret + "&appkey="+ appkey); + string appkey = Request.QueryString["appkey"]; + string response = Util.HttpMethods.HttpGet("http://localhost:20472/SSOSystem/authorize?appid=" + appid + "&secret=" + secret + "&appkey=" + appkey); return Content(response); } 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 928cc635c..303c001e6 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 @@ -6,7 +6,9 @@ * 描 述:经典风格皮肤 */ var autoopenid = request('autoopen'); -var pwd = request("pwd"); +var pwd = request("pwd");//弱密码修改弹框 +var pwdtip = request("pwdtip");//初始密码提示弹框 +var pwdpwdtip = request("pwdpwdtip");//弱密码修改弹框&初始密码提示弹框 var bootstrap = function ($, learun) { "use strict"; // 菜单操作 @@ -197,7 +199,8 @@ var bootstrap = function ($, learun) { // area: ['500px', '300px'] // }); //} - if (pwd == "true") { + //弱密码修改弹框 + if (pwd == "true" || pwdpwdtip == "true") { top.layer.open({ id: 'pwdform', title: '密码修改', @@ -225,6 +228,10 @@ var bootstrap = function ($, learun) { } }); } + //初始密码提示弹框 + if (pwdtip == "true" || pwdpwdtip == "true") { + learun.layerConfirm('当前登录密码还是初始密码!', function (res) { }); + } //上网认证 if (ACIp != null && ACIp != "") { //Ip上网 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/Default.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/Default.cshtml index 72179e6e4..88f5c754f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/Default.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Login/Default.cshtml @@ -49,6 +49,8 @@ + + -