ChangePassword.cshtml 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. @model EMIS.ViewModel.SystemView.ChangePasswordView
  2. @using EMIS.Web.Controls;
  3. @using Bowin.Web.Controls.Mvc;
  4. @{
  5. ViewBag.Title = "ChangePassword";
  6. }
  7. @section scripts{
  8. <script language="javascript">
  9. function Password_Save() {
  10. var reg = /^(?=.*?[A-Z])(?=(.*[a-z]){1,})(?=(.*[\d]){1,})(?=(.*[\W]){1,})(?!.*\s).{8,}$/;
  11. var password = $("#Password").val();
  12. var passwordRep = $("#PasswordRep").val();
  13. if (!reg.test(password) || !reg.test(passwordRep)) {
  14. $.messager.alert('系统提示', '密码策略不符合(必须包含大小写英文字母、数字、字符、长度8位以上)。');
  15. return;
  16. }
  17. if (password != passwordRep) {
  18. $.messager.alert('系统提示', '两次输入的密码必须一致。');
  19. return;
  20. }
  21. $(document.forms[0]).submit();
  22. }
  23. </script>
  24. }
  25. <div class="easyui-panel" data-options="border:false,fit:true" style="position: relative;">
  26. @using (Ajax.BeginForm(new AjaxOptions
  27. {
  28. OnSuccess = "EMISFunction.FormSuccess",
  29. OnBegin = "EMISFunction.FormSubmit",
  30. OnComplete = "EMISFunction.FormComplete"
  31. }))
  32. {
  33. <div class="p_title">
  34. <div style="float: left; margin-left: 10px; line-height: 30px; font-size: 12px;">
  35. 密码修改</div>
  36. <div style="margin-right: 10px; line-height: 30px; font-size: 12px;">
  37. <div class="current_navbar toolbar">
  38. <div class="func_info">
  39. @Html.Button(new ButtonOptions { OnClick = "Password_Save()", Icon = ButtonIcon.Save, Text = "保存" })
  40. </div>
  41. </div>
  42. </div>
  43. </div>
  44. <div class="search_list">
  45. <table cellpadding="0" cellspacing="0" id="departmenttable" width="100%">
  46. <tr>
  47. <td width="20%">@Html.LabelFor(x => x.OldPassword):
  48. </td>
  49. <td>@Html.PasswordFor(x => x.OldPassword, new { placeholder = "请输入旧密码", autocomplete = "off" })
  50. @Html.ValidationMessageFor(x => x.OldPassword)
  51. </td>
  52. </tr>
  53. <tr>
  54. <td>@Html.LabelFor(x => x.Password):
  55. </td>
  56. <td>@Html.PasswordFor(x => x.Password, new { placeholder = "请输入密码", autocomplete = "off" })
  57. </td>
  58. </tr>
  59. <tr>
  60. <td>@Html.LabelFor(x => x.PasswordRep):
  61. </td>
  62. <td>@Html.PasswordFor(x => x.PasswordRep, new { placeholder = "请再次输入密码", autocomplete = "off" })
  63. </td>
  64. </tr>
  65. </table>
  66. </div>
  67. }
  68. </div>