portal html css js resource

cmp-pwdReset01.js 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. //重置企业账户密码
  2. $(function() {
  3. var companyEmailVal;
  4. var setemail = false;
  5. /*校验按钮显示状态*/
  6. $('.companyEmail').on('keyup', function() {
  7. if($(this).val() == "") {
  8. $("#nxetseep").attr("disabled", true);
  9. } else {
  10. $("#nxetseep").attr("disabled", false);
  11. }
  12. });
  13. /*校验企业邮箱*/
  14. $('.companyEmail').on('focus', function() {
  15. $(".msgLog1 span").text("");
  16. });
  17. $('.companyEmail').on('blur', function() {
  18. checkEmail();
  19. });
  20. /*重置密码提交*/
  21. $('#nxetseep').on('click', function() {
  22. mailRegistration();
  23. });
  24. function checkEmail() {
  25. companyEmailVal = $(".companyEmail").val();
  26. var gunf = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
  27. if(gunf.test(companyEmailVal.trim())) {
  28. $.ajax("/ajax/isRegOrg", {
  29. data:{"email":companyEmailVal},
  30. type: "GET",
  31. dataType: 'json',
  32. async: false,
  33. success: function($data) {
  34. if($data.data == true) {
  35. $(".msgLog1").prev().addClass("frmmsg-warning");
  36. $(".msgLog1 span").text("该企业账号不存在,请检查后重试");
  37. } else {
  38. $(".msgLog1").prev().removeClass("frmmsg-warning");
  39. $(".msgLog1 span").text("");
  40. setemail = true;
  41. }
  42. },
  43. error: function() {
  44. $.MsgBox.Alert('提示', '服务器请求失败')
  45. },
  46. });
  47. } else {
  48. $(".msgLog1").prev().addClass("frmmsg-warning");
  49. $(".msgLog1 span").text("请输入正确是邮箱地址");
  50. }
  51. }
  52. function mailRegistration() {
  53. if(setemail) {
  54. $.ajax("/ajax/resetWithOrgEmail", {
  55. data: {
  56. "mail": companyEmailVal,
  57. },
  58. type: "GET",
  59. dataType: 'json',
  60. async: false,
  61. success: function($data) {
  62. console.log($data)
  63. if($data.success) {
  64. if($data.data){
  65. location.href = "cmp-pwdReset02.html?companyEmailVal=" + companyEmailVal;
  66. }else{
  67. $.MsgBox.Alert('提示', '邮箱验证发送失败');
  68. }
  69. }
  70. },
  71. error: function() {
  72. $.MsgBox.Alert('提示', '服务器请求失败');
  73. }
  74. });
  75. } else {
  76. checkEmail();
  77. }
  78. }
  79. })