portal html css js resource

cmp-pwdReset01.js 1.9KB

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