portal html css js resource

cmp-settled-reback.js 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. //找回企业账号
  2. $(function() {
  3. var companyNameVal, companyEmailVal;
  4. var setpass = false;
  5. var setemail = false;
  6. /*校验登录按钮显示状态*/
  7. $('#cmpCoverUl').on('keyup', ".companyEmail,#companyPasw", function() {
  8. if($(".companyEmail").val() == "" || $("#companyPasw").val() == "") {
  9. $("#loginSubmit").attr("disabled", true);
  10. } else {
  11. $("#loginSubmit").attr("disabled", false);
  12. }
  13. });
  14. /*校验企业邮箱*/
  15. $('.companyEmail').on('blur', function() {
  16. checkEmail();
  17. });
  18. /*校验登录密码*/
  19. $('#companyPasw').on('blur', function() {
  20. checkPasw();
  21. });
  22. /*注册提交*/
  23. $('#loginSubmit').on('click', function() {
  24. mailRegistration();
  25. });
  26. function checkEmail() {
  27. companyEmailVal = $(".companyEmail").val();
  28. var gunf = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
  29. if(gunf.test(companyEmailVal.trim())) {
  30. $.ajax("/ajax/isRegOrg", {
  31. data:{"email":companyEmailVal},
  32. type: "GET",
  33. dataType: 'json',
  34. async: false,
  35. success: function($data) {
  36. console.log($data);
  37. if($data.success && $data.data) {
  38. $(".msgLog1 span").text("该企业账号不存在,请检查后重试");
  39. } else {
  40. $(".msgLog1 span").text("");
  41. setemail = true;
  42. }
  43. },
  44. error: function() {
  45. $.MsgBox.Alert('提示', '服务器请求失败')
  46. },
  47. });
  48. } else {
  49. $(".msgLog1 span").text("请输入正确是邮箱地址");
  50. }
  51. }
  52. function checkPasw() {
  53. companyPaswVal = $("#companyPasw").val();
  54. if(companyPaswVal.length < 6) {
  55. $(".msgLog2 span").text("密码由6-24个字符组成,区分大小写");
  56. } else {
  57. $(".msgLog2 span").text("");
  58. setpass = true;
  59. }
  60. }
  61. function mailRegistration() {
  62. if(setpass && setemail) {
  63. $.ajax("/ajax/orgLogin", {
  64. data: {
  65. "lk": companyEmailVal,
  66. "pw": companyPaswVal
  67. },
  68. type: "POST",
  69. dataType: 'json',
  70. async: false,
  71. success: function($data) {
  72. console.log($data)
  73. if($data.success && $data.data!==null) {
  74. location.href = "cmp-workspaces.html";
  75. } else if($data.success && $data.data == null){
  76. $(".msgLog2 span").text("登录账号与密码不匹配");
  77. }
  78. },
  79. error: function() {
  80. $.MsgBox.Alert('提示', '服务器请求失败');
  81. }
  82. });
  83. } else {
  84. checkEmail();
  85. checkPasw();
  86. }
  87. }
  88. })