Browse Source

修改新增教师时的初始密码

heyiwen 1 month ago
parent
commit
d1d01c2755

+ 2 - 2
EMIS.CommonLogic/UniversityInformationManage/TeacherManagement/StaffServices.cs

@@ -268,7 +268,7 @@ namespace EMIS.CommonLogic.TeacherManagement
                     sys_user.Name = staffView.Name;
                     if (parameter == null)
                     {
-                        sys_user.Password = ("A" + staffView.StaffCode).MD5();
+                        sys_user.Password = ("Ab#888888").MD5();
                     }
                     else 
                     {
@@ -278,7 +278,7 @@ namespace EMIS.CommonLogic.TeacherManagement
                         }
                         else 
                         {
-                            sys_user.Password = ("A" + staffView.StaffCode).MD5();
+                            sys_user.Password = ("Ab#888888").MD5();
                         }
                     }
                     //sys_user.Password = Const.USER_INIT_PASSWORD;

+ 8 - 8
EMIS.Web/Controllers/UserManagement/UserController.cs

@@ -250,16 +250,16 @@ namespace EMIS.Web.Controllers.UserManagement
                 try
                 {
                     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 (!(new Regex("^(?=.*?[0-9])(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[#?!@$%^&*-]).{8,}$").IsMatch(pwd)))
+                        {
+                            return Json(new ReturnMessage()
+                            {
+                                IsSuccess = true,
+                                Message = "保存失败,原因:密码须包含大小写英文、特殊字符、数字且长度大于或等于8位!"
+                            });
+                        }
                         pwd = pwd.MD5();
                     }
                     if (batchInitPasswordView.type == 0)