Browse Source

修改密码规则

heyiwen 2 weeks ago
parent
commit
4f28ea3950

+ 9 - 3
EMIS.CommonLogic/SystemServices/UserServices.cs

@@ -360,7 +360,7 @@ namespace EMIS.CommonLogic.SystemServices
                         foreach (var user in list)
                         foreach (var user in list)
                         {
                         {
                             var student = studentList.Where(x => x.UserID == user.UserID).FirstOrDefault();
                             var student = studentList.Where(x => x.UserID == user.UserID).FirstOrDefault();
-                            var passwordstr = "A" + student.IDNumber.Substring(student.IDNumber.Length - 6);
+                            var passwordstr = "Ab!" + student.IDNumber.Substring(student.IDNumber.Length - 6);
                             user.Password = passwordstr.MD5();
                             user.Password = passwordstr.MD5();
                             SetModifyStatus(user);
                             SetModifyStatus(user);
                             userList.Add(user);
                             userList.Add(user);
@@ -371,8 +371,8 @@ namespace EMIS.CommonLogic.SystemServices
                         foreach (var user in list)
                         foreach (var user in list)
                         {
                         {
                             var staff = staffList.Where(x => x.UserID == user.UserID).FirstOrDefault();
                             var staff = staffList.Where(x => x.UserID == user.UserID).FirstOrDefault();
-                            var passwordstr = "A" + staff.CertificatesNum.Substring(staff.CertificatesNum.Length - 6, staff.CertificatesNum.Length);
-                            user.Password = ("888888").MD5();
+                            //var passwordstr = "A" + staff.CertificatesNum.Substring(staff.CertificatesNum.Length - 6, staff.CertificatesNum.Length);
+                            user.Password = ("Ab#888888").MD5();
                             SetModifyStatus(user);
                             SetModifyStatus(user);
                             userList.Add(user);
                             userList.Add(user);
                         }
                         }
@@ -384,6 +384,11 @@ namespace EMIS.CommonLogic.SystemServices
                 }
                 }
                 else 
                 else 
                 {
                 {
+                    if (!(new Regex("^(?=.*?[0-9])(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[#?!@$%^&*-]).{8,}$").IsMatch(pwd)))
+                    {
+                        throw new Exception("密码须包含大小写英文、特殊字符、数字且长度大于或等于8位");
+                    }
+
                     List<Sys_User> list = UserDAL.UserRepository.Entities.Where(x => userID.Contains(x.UserID)).ToList();
                     List<Sys_User> list = UserDAL.UserRepository.Entities.Where(x => userID.Contains(x.UserID)).ToList();
                     List<Sys_User> userList = new List<Sys_User>();
                     List<Sys_User> userList = new List<Sys_User>();
                     foreach (var user in list)
                     foreach (var user in list)
@@ -592,6 +597,7 @@ namespace EMIS.CommonLogic.SystemServices
             user.Password = password.Password.MD5();
             user.Password = password.Password.MD5();
             user.Sys_MailVerifyCode = null;
             user.Sys_MailVerifyCode = null;
             UnitOfWork.Commit();
             UnitOfWork.Commit();
+
         }
         }
 
 
 
 

+ 14 - 6
EMIS.Utility/FormValidate/CustomPrincipal.cs

@@ -28,6 +28,8 @@ namespace EMIS.Utility.FormValidate
             get { return StudentID.HasValue; }
             get { return StudentID.HasValue; }
         }
         }
         public Guid? RoleID { get; set; }
         public Guid? RoleID { get; set; }
+        public bool? NeedChangePwd { get; set; }
+        public string NeedChangePwdReason { get; set; }
 
 
         public void ProcessData(System.Security.Principal.IIdentity id, string data)
         public void ProcessData(System.Security.Principal.IIdentity id, string data)
         {
         {
@@ -44,12 +46,14 @@ namespace EMIS.Utility.FormValidate
             this.DepartmentID = string.IsNullOrEmpty(set[5]) ? new Nullable<Guid>() : new Nullable<Guid>(Guid.Parse(set[5]));
             this.DepartmentID = string.IsNullOrEmpty(set[5]) ? new Nullable<Guid>() : new Nullable<Guid>(Guid.Parse(set[5]));
             this.DepartmentHierarchyID = set[6];
             this.DepartmentHierarchyID = set[6];
             this.DepartmentName = set[7];
             this.DepartmentName = set[7];
-            this.CollegeID = string.IsNullOrEmpty(set[8]) ? new Nullable<Guid>() : new Nullable<Guid>(Guid.Parse(set[8]));
+            this.NeedChangePwd = string.IsNullOrEmpty(set[8]) ? false : (set[8] == "1");
+            this.NeedChangePwdReason = set[9];
+            this.CollegeID = string.IsNullOrEmpty(set[10]) ? new Nullable<Guid>() : new Nullable<Guid>(Guid.Parse(set[10]));
             //this.CampusID = string.IsNullOrEmpty(set[9]) ? new Nullable<Guid>() : new Nullable<Guid>(Guid.Parse(set[9]));
             //this.CampusID = string.IsNullOrEmpty(set[9]) ? new Nullable<Guid>() : new Nullable<Guid>(Guid.Parse(set[9]));
             //this.UniversityID = string.IsNullOrEmpty(set[10]) ? new Nullable<Guid>() : new Nullable<Guid>(Guid.Parse(set[10]));
             //this.UniversityID = string.IsNullOrEmpty(set[10]) ? new Nullable<Guid>() : new Nullable<Guid>(Guid.Parse(set[10]));
-            if (set.Length == 10)
+            if (set.Length == 12)
             {
             {
-                this.RoleID = string.IsNullOrEmpty(set[9]) ? new Nullable<Guid>() : new Nullable<Guid>(Guid.Parse(set[9]));
+                this.RoleID = string.IsNullOrEmpty(set[11]) ? new Nullable<Guid>() : new Nullable<Guid>(Guid.Parse(set[11]));
             }
             }
         }
         }
         public void ProcessData(string data)
         public void ProcessData(string data)
@@ -64,12 +68,14 @@ namespace EMIS.Utility.FormValidate
             this.DepartmentID = string.IsNullOrEmpty(set[5]) ? new Nullable<Guid>() : new Nullable<Guid>(Guid.Parse(set[5]));
             this.DepartmentID = string.IsNullOrEmpty(set[5]) ? new Nullable<Guid>() : new Nullable<Guid>(Guid.Parse(set[5]));
             this.DepartmentHierarchyID = set[6];
             this.DepartmentHierarchyID = set[6];
             this.DepartmentName = set[7];
             this.DepartmentName = set[7];
-            this.CollegeID = string.IsNullOrEmpty(set[8]) ? new Nullable<Guid>() : new Nullable<Guid>(Guid.Parse(set[8]));
+            this.NeedChangePwd = string.IsNullOrEmpty(set[8]) ? false : (set[8] == "1");
+            this.NeedChangePwdReason = set[9];
+            this.CollegeID = string.IsNullOrEmpty(set[10]) ? new Nullable<Guid>() : new Nullable<Guid>(Guid.Parse(set[10]));
             //this.CampusID = string.IsNullOrEmpty(set[9]) ? new Nullable<Guid>() : new Nullable<Guid>(Guid.Parse(set[9]));
             //this.CampusID = string.IsNullOrEmpty(set[9]) ? new Nullable<Guid>() : new Nullable<Guid>(Guid.Parse(set[9]));
             //this.UniversityID = string.IsNullOrEmpty(set[10]) ? new Nullable<Guid>() : new Nullable<Guid>(Guid.Parse(set[10]));
             //this.UniversityID = string.IsNullOrEmpty(set[10]) ? new Nullable<Guid>() : new Nullable<Guid>(Guid.Parse(set[10]));
-            if (set.Length == 10)
+            if (set.Length == 12)
             {
             {
-                this.RoleID = string.IsNullOrEmpty(set[9]) ? new Nullable<Guid>() : new Nullable<Guid>(Guid.Parse(set[9]));
+                this.RoleID = string.IsNullOrEmpty(set[11]) ? new Nullable<Guid>() : new Nullable<Guid>(Guid.Parse(set[11]));
             }
             }
             _current = this;
             _current = this;
         }
         }
@@ -86,6 +92,8 @@ namespace EMIS.Utility.FormValidate
             userData.Add(this.DepartmentID == null ? "" : this.DepartmentID.ToString());
             userData.Add(this.DepartmentID == null ? "" : this.DepartmentID.ToString());
             userData.Add(this.DepartmentHierarchyID);
             userData.Add(this.DepartmentHierarchyID);
             userData.Add(this.DepartmentName);
             userData.Add(this.DepartmentName);
+            userData.Add(this.NeedChangePwd == null ? "" : this.NeedChangePwd.Value ? "1" : "");
+            userData.Add(this.NeedChangePwdReason);
             userData.Add(this.CollegeID == null ? "" : this.CollegeID.ToString());
             userData.Add(this.CollegeID == null ? "" : this.CollegeID.ToString());
             //userData.Add(this.CampusID == null ? "" : this.CampusID.ToString());
             //userData.Add(this.CampusID == null ? "" : this.CampusID.ToString());
             //userData.Add(this.UniversityID == null ? "" : this.UniversityID.ToString());
             //userData.Add(this.UniversityID == null ? "" : this.UniversityID.ToString());

+ 2 - 1
EMIS.ViewModel/Account/LogOnModel.cs

@@ -41,6 +41,7 @@ namespace EMIS.ViewModel.Account
             }
             }
         }
         }
 
 
-
+        public bool NeedChangePwd { get; set; }
+        public string NeedChangePwdReason { get; set; }
     }
     }
 }
 }

+ 2 - 1
EMIS.ViewModel/SystemView/ChangePasswordView.cs

@@ -17,7 +17,8 @@ namespace EMIS.ViewModel.SystemView
 
 
         [Required]
         [Required]
         [DataType(DataType.Password)]
         [DataType(DataType.Password)]
-        [StringLength(50, ErrorMessage = "密码长度不能小于6位", MinimumLength = 6)]
+        [StringLength(50, ErrorMessage = "密码长度不能小于6位", MinimumLength = 8)]
+        [RegularExpression("^(?=.*?[0-9])(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[#?!@$%^&*-]).{8,}$", ErrorMessage = "密码须包含大小写英文、特殊字符、数字且长度大于或等于8位")]
         [DisplayName("新密码")]
         [DisplayName("新密码")]
         public string Password { get; set; }
         public string Password { get; set; }
 
 

+ 1 - 0
EMIS.Web/Controllers/AccountController.cs

@@ -129,6 +129,7 @@ namespace EMIS.Web.Controllers
                         {
                         {
                             this.LoginSureccessful(model, model.UserName);
                             this.LoginSureccessful(model, model.UserName);
 
 
+
                             var referrer = HttpContext.Request.UrlReferrer;
                             var referrer = HttpContext.Request.UrlReferrer;
                             if (referrer != null)
                             if (referrer != null)
                             {
                             {

+ 5 - 0
EMIS.Web/Controllers/HomeController.cs

@@ -67,6 +67,11 @@ namespace EMIS.Web.Controllers
             return View();
             return View();
         }
         }
 
 
+        public ActionResult MainChangePwd()
+        {
+            return View();
+        }
+
         public ActionResult UploaderSave(FormCollection form)
         public ActionResult UploaderSave(FormCollection form)
         {
         {
             Response.Cache.SetNoStore();
             Response.Cache.SetNoStore();

+ 9 - 0
EMIS.Web/Controllers/UserManagement/UserController.cs

@@ -15,6 +15,7 @@ using EMIS.Utility;
 using EMIS.CommonLogic.TeacherManagement;
 using EMIS.CommonLogic.TeacherManagement;
 using EMIS.ViewModel.TeacherManagement;
 using EMIS.ViewModel.TeacherManagement;
 using EMIS.Utility.FormValidate;
 using EMIS.Utility.FormValidate;
+using System.Text.RegularExpressions;
 
 
 namespace EMIS.Web.Controllers.UserManagement
 namespace EMIS.Web.Controllers.UserManagement
 {
 {
@@ -249,6 +250,14 @@ namespace EMIS.Web.Controllers.UserManagement
                 try
                 try
                 {
                 {
                     string pwd = batchInitPasswordView.Password;
                     string pwd = batchInitPasswordView.Password;
+                    if (!(new Regex("^(?=.*?[0-9])(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[#?!@$%^&*-]).{8,}$").IsMatch(pwd)))
+                    {
+                        return Json(new ReturnMessage()
+                        {
+                            IsSuccess = true,
+                            Message = "保存失败,原因:密码须包含大小写英文、特殊字符、数字且长度大于或等于8位!"
+                        });
+                    }
                     if (pwd != null && batchInitPasswordView.BatchInt == true)
                     if (pwd != null && batchInitPasswordView.BatchInt == true)
                     {
                     {
                         pwd = pwd.MD5();
                         pwd = pwd.MD5();

+ 11 - 0
EMIS.Web/Controls/Authorization.cs

@@ -51,11 +51,22 @@ namespace System
                 fahelper.AuthenticateRequest(HttpContext.Current, cookieName, Const.LOCAL_AUTH_EXCEPTURL);
                 fahelper.AuthenticateRequest(HttpContext.Current, cookieName, Const.LOCAL_AUTH_EXCEPTURL);
 
 
                 var userInfo = EMIS.Utility.FormValidate.CustomPrincipal.Current;
                 var userInfo = EMIS.Utility.FormValidate.CustomPrincipal.Current;
+                if (userInfo != null && userInfo.NeedChangePwd == true
+                    && !filterContext.HttpContext.Request.Path.Contains("/Home/MainChangePwd")
+                    && !filterContext.HttpContext.Request.Path.Contains("/Account/ChangePassword")
+                    && !filterContext.HttpContext.Request.Path.Contains("/Account/Login")
+                    && !filterContext.HttpContext.Request.Path.Contains("/Account/LogOff"))
+                {
+                    filterContext.HttpContext.Response.RedirectPermanent("~/Home/MainChangePwd", true);
+                    return;
+                }
                 if (userInfo != null && userInfo.IsStudent)
                 if (userInfo != null && userInfo.IsStudent)
                 {
                 {
                     using (var scope = AutofacHelper.Container.BeginLifetimeScope())
                     using (var scope = AutofacHelper.Container.BeginLifetimeScope())
                     {
                     {
                         if (!filterContext.HttpContext.Request.Path.Contains("/Account/FinishInfomation")
                         if (!filterContext.HttpContext.Request.Path.Contains("/Account/FinishInfomation")
+                            && !filterContext.HttpContext.Request.Path.Contains("/Home/MainChangePwd")
+                            && !filterContext.HttpContext.Request.Path.Contains("/Account/ChangePassword")
                             && !filterContext.HttpContext.Request.Path.Contains("/Home/Index")
                             && !filterContext.HttpContext.Request.Path.Contains("/Home/Index")
                             && !filterContext.HttpContext.Request.Path.Contains("/Common/")
                             && !filterContext.HttpContext.Request.Path.Contains("/Common/")
                             && !filterContext.HttpContext.Request.Path.Contains("/GetUserRoleDropdownList")
                             && !filterContext.HttpContext.Request.Path.Contains("/GetUserRoleDropdownList")

+ 10 - 0
EMIS.Web/Controls/BaseExtensions.cs

@@ -234,6 +234,14 @@ namespace EMIS.Web.Controls
                 {
                 {
                     defaultRole = userServices.GetMaxPrivilegeRoleByUserID(userpageResult.UserID);
                     defaultRole = userServices.GetMaxPrivilegeRoleByUserID(userpageResult.UserID);
                 }
                 }
+                else
+                {//是学生的话,检查一下密码是不是初始密码
+                    if (model.Password.ToUpper() == ("Ab!" + userpageResult.CF_Student.IDNumber.Substring(userpageResult.CF_Student.IDNumber.Length - 6)).MD5())
+                    {
+                        model.NeedChangePwd = true;
+                        model.NeedChangePwdReason = "你在重置密码后首次登录";
+                    }
+                }
             }
             }
 
 
             if (model.RememberMe)
             if (model.RememberMe)
@@ -253,6 +261,8 @@ namespace EMIS.Web.Controls
             userData.Add((userpageResult.CF_Staff != null && userpageResult.CF_Staff.CF_Department != null) ? userpageResult.CF_Staff.DepartmentID.ToString() : "");//部门(教研室)ID
             userData.Add((userpageResult.CF_Staff != null && userpageResult.CF_Staff.CF_Department != null) ? userpageResult.CF_Staff.DepartmentID.ToString() : "");//部门(教研室)ID
             userData.Add((userpageResult.CF_Staff != null && userpageResult.CF_Staff.CF_Department != null) ? userpageResult.CF_Staff.CF_Department.HierarchyID : "");//部门(教研室)树结构ID
             userData.Add((userpageResult.CF_Staff != null && userpageResult.CF_Staff.CF_Department != null) ? userpageResult.CF_Staff.CF_Department.HierarchyID : "");//部门(教研室)树结构ID
             userData.Add((userpageResult.CF_Staff != null && userpageResult.CF_Staff.CF_Department != null) ? userpageResult.CF_Staff.CF_Department.Name : "");//部门(教研室)名称
             userData.Add((userpageResult.CF_Staff != null && userpageResult.CF_Staff.CF_Department != null) ? userpageResult.CF_Staff.CF_Department.Name : "");//部门(教研室)名称
+            userData.Add(model.NeedChangePwd ? "1" : "");
+            userData.Add(model.NeedChangePwdReason);
             if (userpageResult.CF_Student == null)
             if (userpageResult.CF_Student == null)
             {
             {
                 if (userpageResult.CF_Staff != null && userpageResult.CF_Staff.CF_College != null)
                 if (userpageResult.CF_Staff != null && userpageResult.CF_Staff.CF_College != null)

+ 1 - 0
EMIS.Web/EMIS.Web.csproj

@@ -2581,6 +2581,7 @@
     <Content Include="Views\Announcement\EditGDCX.cshtml" />
     <Content Include="Views\Announcement\EditGDCX.cshtml" />
     <Content Include="Views\Common\UserAnnouncementSendGDCX.cshtml" />
     <Content Include="Views\Common\UserAnnouncementSendGDCX.cshtml" />
     <Content Include="Views\Test\SignName.cshtml" />
     <Content Include="Views\Test\SignName.cshtml" />
+    <Content Include="Views\Home\MainChangePwd.cshtml" />
   </ItemGroup>
   </ItemGroup>
   <PropertyGroup>
   <PropertyGroup>
     <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
     <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>

+ 18 - 6
EMIS.Web/Scripts/Business/Common/Login.js

@@ -6,15 +6,11 @@
         $(".loginbutton").css("background-color", "#4A7DC6");
         $(".loginbutton").css("background-color", "#4A7DC6");
     });
     });
     $(".loginbutton").click(function () {
     $(".loginbutton").click(function () {
-        $(".loginbutton")[0].innerText = "      登 录 中...   ";
-        passwordMD5();
-        $(document.forms[0]).submit();
+        loginProcess();
     });
     });
     $(document).keyup(function (e) {
     $(document).keyup(function (e) {
         if (e.keyCode == 13) {
         if (e.keyCode == 13) {
-            $(".loginbutton")[0].innerText = "      登 录 中...   ";
-            passwordMD5();
-            $(document.forms[0]).submit();
+            loginProcess();
         }
         }
     });
     });
     $.post(CMS_SystemConfig.VirtualDirectoryPath + '/Account/GetLoginTip', null, function (data) {
     $.post(CMS_SystemConfig.VirtualDirectoryPath + '/Account/GetLoginTip', null, function (data) {
@@ -24,6 +20,22 @@
     });
     });
 })
 })
 
 
+function loginProcess() {
+    $(".loginbutton")[0].innerText = "      登 录 中...   ";
+    var reg = /^(?=.*?[0-9])(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[#?!@$%^&*-]).{8,}$/g;
+    if (!reg.test($("#Password").val())) {
+        $("#NeedChangePwd").val("true");
+        $("#NeedChangePwdReason").val("密码须包含大小写英文、特殊字符、数字且长度大于或等于8位");
+    }
+    if ($("#Password").val() == "Ab#888888") {
+        $("#NeedChangePwd").val("true");
+        $("#NeedChangePwdReason").val("你在重置密码后首次登录");
+    }
+    passwordMD5();
+
+    $(document.forms[0]).submit();
+}
+
 function passwordMD5() {
 function passwordMD5() {
     var password = $("#Password").val();
     var password = $("#Password").val();
     $("#Password").val($.md5(password));
     $("#Password").val($.md5(password));

+ 2 - 0
EMIS.Web/Views/Account/Login.cshtml

@@ -37,6 +37,8 @@
                 @Html.AntiForgeryToken()
                 @Html.AntiForgeryToken()
                 @Html.ValidationSummary(true)
                 @Html.ValidationSummary(true)
                 @Html.Hidden("LoginID");
                 @Html.Hidden("LoginID");
+                @Html.HiddenFor(m => m.NeedChangePwd)
+                @Html.HiddenFor(m => m.NeedChangePwdReason)
                 <table align="center" valign="center" width="218" height="168" border="0" cellpadding="0"
                 <table align="center" valign="center" width="218" height="168" border="0" cellpadding="0"
                        cellspacing="0">
                        cellspacing="0">
                     <tr>
                     <tr>

+ 132 - 0
EMIS.Web/Views/Home/MainChangePwd.cshtml

@@ -0,0 +1,132 @@
+@model EMIS.ViewModel.SystemView.ChangePasswordView
+@using Bowin.Web.Controls.Mvc;
+@using EMIS.Web.Controls;
+@using Bowin.Common;
+@{
+    Layout = "~/Views/Shared/_FrameLayout.cshtml";
+    List<string> lurl = new List<string>();
+
+    lurl.Add("Content/");
+    lurl.Add("Doc/");
+    lurl.Add("Scripts/");
+    lurl.Add("Login/");
+    lurl.Add("UploadFile/");
+    lurl.Add("Account/ChangePassword");
+
+    FormsAuthenticationHelper fahelper = new FormsAuthenticationHelper();
+
+    var cookieName = EMIS.Utility.Const.LOCAL_SETTING_LOGIN_COOKIENAME;
+
+    fahelper.AuthenticateRequest(HttpContext.Current, cookieName, lurl);
+}
+@section scripts{
+    <script type="text/javascript">
+        function Password_Save() {
+            if ($("#Password").val() != $("#PasswordRep").val()) {
+                $.messager.alert('系统提示', '两次输入的密码必须一致', 'info');
+                return;
+            }
+            $(document.forms[0]).submit();
+        }
+
+        function ChangeSuccess (data) {
+            $('a').removeAttr('disabled', 'disabled');
+            $('#loading').hide();
+            if (data.IsSuccess) {
+                $.messager.alert('系统信息', "密码修改成功,请重新登录", null, function () {
+                    location.href = "@Url.Content("~/Account/LogOff")";
+                });
+            } else {
+                $.messager.alert('系统信息', data.Message, null);
+            }
+        }
+    </script>
+}
+<div data-options="region:'north',title:'',split:false, border:false" class="index_top_banner">
+    <div class="index_top_bg">
+        <div id="index_top" class="index_top_left">
+            <img src="@Url.Content("~/common/ResImage?key=HomeLogo")" />
+        </div>
+        <div id="divCurrentInformation">
+            当前用户:@(((EMIS.Utility.FormValidate.CustomPrincipal)Context.User).LoginID + "-" + ((EMIS.Utility.FormValidate.CustomPrincipal)Context.User).Name + (((EMIS.Utility.FormValidate.CustomPrincipal)Context.User).IsStudent ? "同学" : "老师"))&nbsp;&nbsp;@Html.SystemClock(new SystemClockOptions { IsJump = true })
+        </div>
+        <div style="float: right; padding-right: 30px; padding-top: 40px;">
+            &nbsp;&nbsp; <a href="@Url.Content("~/Account/LogOff")" style="z-index: 99999;">
+                <img border="0" title="退出" src="@Url.Content("~/Content/Bowin.Control.Core/images/h_logout.jpg")" />
+            </a>
+        </div>
+    </div>
+</div>
+<div id="index_left" class="index_left_bg" data-options="region:'west',title:'',split:false,tools:'#tab-tools'"
+     style="width: 150px;">
+</div>
+<div region="center" border="true" title="" class="index_center_bg">
+    <div id="index_main" class="easyui-layout" data-options="border:false,fit:true">
+        <div data-options="region:'center',border:false">
+            <div class="easyui-panel" data-options="border:false,fit:true" style="position: relative;">
+                @using (Ajax.BeginForm(new AjaxOptions
+                {
+                    Url = Url.Content("~/Account/ChangePassword"),
+                    OnSuccess = "ChangeSuccess",
+                    OnBegin = "EMISFunction.FormSubmit",
+                    OnComplete = "EMISFunction.FormComplete"
+                }))
+                {
+                    <div class="p_title">
+                        <div style="float: left; margin-left: 10px; line-height: 30px; font-size: 12px;">
+                            <span style="color: #000000">@(((EMIS.Utility.FormValidate.CustomPrincipal)Context.User).NeedChangePwdReason),请修改密码</span>
+                        </div>
+                        <div style="margin-right: 10px; line-height: 30px; font-size: 12px;">
+                            <div class="current_navbar toolbar">
+                                <div class="func_info">
+                                    @Html.Button(new ButtonOptions { OnClick = "Password_Save()", Icon = ButtonIcon.Save, Text = "保存" })
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                    <div class="search_list">
+                        <table cellpadding="0" cellspacing="0" id="departmenttable" width="100%">
+                            <tr>
+                                <td width="20%">
+                                    @Html.LabelFor(x => x.OldPassword):
+                                </td>
+                                <td>
+                                    @Html.PasswordFor(x => x.OldPassword, new { placeholder = "请输入旧密码", autocomplete = "off" })
+                                    @Html.ValidationMessageFor(x => x.OldPassword)
+                                </td>
+                            </tr>
+                            <tr>
+                                <td>
+                                    @Html.LabelFor(x => x.Password):
+                                </td>
+                                <td>
+                                    @Html.PasswordFor(x => x.Password, new { placeholder = "请输入密码", autocomplete = "off" })
+                                </td>
+                            </tr>
+                            <tr>
+                                <td>
+                                    @Html.LabelFor(x => x.PasswordRep):
+                                </td>
+                                <td>
+                                    @Html.PasswordFor(x => x.PasswordRep, new { placeholder = "请再次输入密码", autocomplete = "off" })
+                                </td>
+                            </tr>
+                        </table>
+                    </div>
+                }
+            </div>
+        </div>
+    </div>
+</div>
+<div id="index_bottom" class="index_bottom_bg" region="south" border="true" title="">
+    <div style="float: left; width: 40%; text-align: center; white-space: nowrap;">
+        教育部中央教育科学研究所高等教育研究中心监制
+    </div>
+    <div style="float: right; width: 40%; text-align:right; white-space: nowrap;">
+        <a href="http://www.bowintek.com" target="_blank">
+            Copyright <img src="~/Images/copyright.png" style="height:10px" /> 广州市博颖信息科技有限公司 All Rights Reserved
+        </a>
+    </div>
+</div>
+<div id="sysWindow">
+</div>

+ 12 - 3
EMIS.Web/Views/Shared/_FrameLayout.cshtml

@@ -7,10 +7,10 @@
     <title>@EMIS.Utility.RSL.Get("Title")</title>
     <title>@EMIS.Utility.RSL.Get("Title")</title>
     <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
     <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
     <link rel="stylesheet" type="text/css" href="@Url.Content("~/Content/Bowin.Control.Core/themes/metro-blue/easyui.css")" />
     <link rel="stylesheet" type="text/css" href="@Url.Content("~/Content/Bowin.Control.Core/themes/metro-blue/easyui.css")" />
-    <link rel="stylesheet" type="text/css" href="@Url.Content("~/Content/Bowin.Control.Core/themes/icon.css")"/>
+    <link rel="stylesheet" type="text/css" href="@Url.Content("~/Content/Bowin.Control.Core/themes/icon.css")" />
     <script type="text/javascript" src="@Url.Content("~/Scripts/jquery-1.8.0.min.js")"></script>
     <script type="text/javascript" src="@Url.Content("~/Scripts/jquery-1.8.0.min.js")"></script>
-    <script type="text/javascript" src="@Url.Content("~/Scripts/Bowin.Control.Core/Plugins/EasyUI/jquery.easyui.min.js")" ></script>
-    <script type="text/javascript" src="@Url.Content("~/Scripts/Bowin.Control.Core/Plugins/EasyUI/easyui-lang-zh_CN.js")" ></script>
+    <script type="text/javascript" src="@Url.Content("~/Scripts/Bowin.Control.Core/Plugins/EasyUI/jquery.easyui.min.js")"></script>
+    <script type="text/javascript" src="@Url.Content("~/Scripts/Bowin.Control.Core/Plugins/EasyUI/easyui-lang-zh_CN.js")"></script>
     <script src="@Url.Content("~/Scripts/json2.js")" type="text/javascript"></script>
     <script src="@Url.Content("~/Scripts/json2.js")" type="text/javascript"></script>
     <script src="@Url.Content("~/Scripts/Bowin.Control.Core/Core/Extend/JavaScript.Extend.js")" type="text/javascript"></script>
     <script src="@Url.Content("~/Scripts/Bowin.Control.Core/Core/Extend/JavaScript.Extend.js")" type="text/javascript"></script>
     <script src="@Url.Content("~/Scripts/Bowin.Control.Core/Core/CMS.Core.js")" type="text/javascript"></script>
     <script src="@Url.Content("~/Scripts/Bowin.Control.Core/Core/CMS.Core.js")" type="text/javascript"></script>
@@ -20,6 +20,15 @@
     <script src="@Url.Content("~/Scripts/Bowin.Control.Core/Core/Config/CMS.Config.js")" type="text/javascript"></script>
     <script src="@Url.Content("~/Scripts/Bowin.Control.Core/Core/Config/CMS.Config.js")" type="text/javascript"></script>
     <script src="@Url.Content("~/Scripts/Bowin.Control.Core/Core/Controls/Bowin.Controls.js")" type="text/javascript"></script>
     <script src="@Url.Content("~/Scripts/Bowin.Control.Core/Core/Controls/Bowin.Controls.js")" type="text/javascript"></script>
     <script src="@Url.Content("~/Scripts/Bowin.Control.Core/Core/Controls/CMS.Controls.js")" type="text/javascript"></script>
     <script src="@Url.Content("~/Scripts/Bowin.Control.Core/Core/Controls/CMS.Controls.js")" type="text/javascript"></script>
+    <script src="@Url.Content("~/Scripts/Bowin.Control.Core/jquery.validate.min.js")" type="text/javascript"></script>
+    <script src="@Url.Content("~/Scripts/Bowin.Control.Core/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
+    <script type="text/javascript" src="@Url.Content("~/Scripts/Bowin.Control.Core/jquery.unobtrusive-ajax.min.js")"></script>
+    <script src="@Url.Content("~/Scripts/Bowin.Control.Core/Core/Extend/jQuery.Validate.Extend.js")" type="text/javascript"></script>
+    <script src="@Url.Content("~/Scripts/MicrosoftAjax.js")" type="text/javascript"></script>
+    <script src="@Url.Content("~/Scripts/MicrosoftMvcAjax.js")" type="text/javascript"></script>
+    <script src="@Url.Content("~/Scripts/MicrosoftMvcValidation.js")" type="text/javascript"></script>
+    <script src="@Url.Content("~/Scripts/jquery.validate.easyui.js")" type="text/javascript"></script>
+    <script src="@Url.Content("~/Scripts/SystemGeneral.js")" type="text/javascript"></script>
 </head>
 </head>
 <body class="easyui-layout" id='bodyLayout'>
 <body class="easyui-layout" id='bodyLayout'>
     @RenderBody()
     @RenderBody()

+ 2 - 2
EMIS.Web/Views/User/BatchInitPassword.cshtml

@@ -86,12 +86,12 @@
                     <td colspan="2">
                     <td colspan="2">
                         @if (Request["isView"] == "1" || Request["isView"] == "2")
                         @if (Request["isView"] == "1" || Request["isView"] == "2")
                         {
                         {
-                            <p>默认密码为 888888</p>
+                            <p>默认密码为 Ab#888888</p>
                         }
                         }
 
 
                         @if (Request["isView"] == "3" || Request["isView"] == "4")
                         @if (Request["isView"] == "3" || Request["isView"] == "4")
                         {
                         {
-                            <p>默认密码为 A + 证件号码后六位</p>
+                            <p>默认密码为 Ab! + 证件号码后六位</p>
                         }
                         }
                     </td>
                     </td>
                     
                     

+ 3 - 3
EMIS.Web/Web.config

@@ -15,10 +15,10 @@
   </configSections>
   </configSections>
   <connectionStrings>
   <connectionStrings>
     <!--岭南考试系统-->
     <!--岭南考试系统-->
-    <add name="EMISNewContext" providerName="System.Data.SqlClient" connectionString="Data Source=192.168.0.66\LIOT;Initial Catalog=LIOT.Exam20210331001;Persist Security Info=True;User ID=sa;Password=1;Pooling=True;Max Pool Size=10000;" />
+    <add name="EMISNewContext" providerName="System.Data.SqlClient" connectionString="Data Source=192.168.0.66\LIOT;Initial Catalog=LIOT.Exam20210331001;Persist Security Info=True;User ID=sa;Password=Bowin2023!;Pooling=True;Max Pool Size=10000;" />
     <add name="DataCenterContextContainer" connectionString="metadata=res://*/DataCenterContext.csdl|res://*/DataCenterContext.ssdl|res://*/DataCenterContext.msl;provider=MySql.Data.MySqlClient;provider connection string=&quot;server=192.168.0.66;user id=root;password=bowin123;persistsecurityinfo=True;database=dbcenter&quot;" providerName="System.Data.EntityClient" />
     <add name="DataCenterContextContainer" connectionString="metadata=res://*/DataCenterContext.csdl|res://*/DataCenterContext.ssdl|res://*/DataCenterContext.msl;provider=MySql.Data.MySqlClient;provider connection string=&quot;server=192.168.0.66;user id=root;password=bowin123;persistsecurityinfo=True;database=dbcenter&quot;" providerName="System.Data.EntityClient" />
-    <add name="HRServiceContextContainer" providerName="System.Data.SqlClient" connectionString="Data Source=192.168.0.66\LIOT;Initial Catalog=Emis.HRService;Persist Security Info=True;User ID=sa;Password=1;Pooling=True;Max Pool Size=10000;" />
-    <add name="EMISNewLogContext" providerName="System.Data.SqlClient" connectionString="Data Source=192.168.0.66\LIOT;Initial Catalog=LIOT.ExamLog;Persist Security Info=True;User ID=sa;Password=1;Pooling=True;Max Pool Size=10000;" />
+    <add name="HRServiceContextContainer" providerName="System.Data.SqlClient" connectionString="Data Source=192.168.0.66\LIOT;Initial Catalog=Emis.HRService;Persist Security Info=True;User ID=sa;Password=Bowin2023!;Pooling=True;Max Pool Size=10000;" />
+    <add name="EMISNewLogContext" providerName="System.Data.SqlClient" connectionString="Data Source=192.168.0.66\LIOT;Initial Catalog=LIOT.ExamLog;Persist Security Info=True;User ID=sa;Password=Bowin2023!;Pooling=True;Max Pool Size=10000;" />
     <add name="LYDataContext" connectionString="metadata=res://*/LYDATA.csdl|res://*/LYDATA.ssdl|res://*/LYDATA.msl;provider=Oracle.ManagedDataAccess.Client;provider connection string=&quot;DATA SOURCE=192.168.0.68:1521/LYDATA.LIOT;PASSWORD=1;PERSIST SECURITY INFO=True;USER ID=LYDATA&quot;" providerName="System.Data.EntityClient" />
     <add name="LYDataContext" connectionString="metadata=res://*/LYDATA.csdl|res://*/LYDATA.ssdl|res://*/LYDATA.msl;provider=Oracle.ManagedDataAccess.Client;provider connection string=&quot;DATA SOURCE=192.168.0.68:1521/LYDATA.LIOT;PASSWORD=1;PERSIST SECURITY INFO=True;USER ID=LYDATA&quot;" providerName="System.Data.EntityClient" />
     <!--<add name="EMISNewContext" providerName="System.Data.SqlClient" connectionString="Data Source=192.168.42.55;Initial Catalog=LIOT.Exam;Persist Security Info=True;User ID=exam;Password=exam!2#;Pooling=True;Max Pool Size=10000;" />
     <!--<add name="EMISNewContext" providerName="System.Data.SqlClient" connectionString="Data Source=192.168.42.55;Initial Catalog=LIOT.Exam;Persist Security Info=True;User ID=exam;Password=exam!2#;Pooling=True;Max Pool Size=10000;" />
     <add name="DataCenterContextContainer" connectionString="metadata=res://*/DataCenterContext.csdl|res://*/DataCenterContext.ssdl|res://*/DataCenterContext.msl;provider=MySql.Data.MySqlClient;provider connection string=&quot;server=192.168.45.12;user id=to_jdkszx;password=jdkszx@2019;persistsecurityinfo=True;database=dbcenter&quot;" providerName="System.Data.EntityClient" />
     <add name="DataCenterContextContainer" connectionString="metadata=res://*/DataCenterContext.csdl|res://*/DataCenterContext.ssdl|res://*/DataCenterContext.msl;provider=MySql.Data.MySqlClient;provider connection string=&quot;server=192.168.45.12;user id=to_jdkszx;password=jdkszx@2019;persistsecurityinfo=True;database=dbcenter&quot;" providerName="System.Data.EntityClient" />

BIN
Lib/Bowin.Common.Mvc.dll


BIN
Lib/Bowin.Common.dll


BIN
Lib/Bowin.Web.Controls.Mvc.dll