beeMansLogin.html 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <link rel="icon" href="../static/img/favicon2.ico" type="img/x-ico">
  7. <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0">
  8. <title>双子星登录</title>
  9. <link rel="stylesheet" href="../static/js/vender/toastr/toastr.min.css">
  10. <link rel="stylesheet" href="../static/css/beeMansLogin.css">
  11. </head>
  12. <body>
  13. <div class="fcnc">
  14. <img class="logo" src="../static/img/beeMans/logo.png" alt="">
  15. <div class="login-title">双子星登录</div>
  16. <div class="login-subtitle">- 来至云端的手机 -</div>
  17. <div class="input-item mb30">
  18. <div class="icon"><img class="icon-user" src="../static/img/beeMans/icon-user.png" alt=""></div>
  19. <input type="tel" placeholder="双子星账号登录" maxlength="11" id="tel_input">
  20. </div>
  21. <div class="input-item mb110">
  22. <div class="icon"><img class="icon-user" src="../static/img/beeMans/icon-password.png" alt=""></div>
  23. <input type="password" id="tel_pass" placeholder="请输入密码">
  24. </div>
  25. <div class="btn" onclick="handleClick()">登录</div>
  26. </div>
  27. <div class="master" onclick="stop()">
  28. <div class="loading">
  29. <div class="loadingSix">
  30. <span></span>
  31. <span></span>
  32. <span></span>
  33. <span></span>
  34. <span></span>
  35. <span></span>
  36. <span></span>
  37. <span></span>
  38. </div>
  39. <p>正在登录</p>
  40. </div>
  41. </div>
  42. </body>
  43. <script src="../static/js/vender/jquery-3.4.1.min.js"></script>
  44. <script src="../static/js/vender/toastr/toastr.min.js"></script>
  45. <script src="../static/js/vender/jsencrypt.js"></script>
  46. <script src="../static/js/vender/md5.js"></script>
  47. <script src="../static/js/vender/config.js"></script>
  48. <script type="text/javascript">
  49. toastr.options.timeOut = 500;
  50. toastr.options.positionClass = 'toast-center-center';
  51. $("#tel_input").bind('input propertychange', function (e) {
  52. var ipt_phones = $('#tel_input').val();
  53. var c = $(this);
  54. if (/[^\d]/.test(c.val())) {//替换非数字字符
  55. var temp_amount = c.val().replace(/[^\d]/g, '');
  56. $(this).val(temp_amount);
  57. toastr.error('请填写正确的手机号')
  58. }
  59. });
  60. function stop() {
  61. event.stopPropagation();
  62. };
  63. function handleClick() {
  64. var ipt_phone = $('#tel_input').val();
  65. var ipt_pass = $('#tel_pass').val();
  66. if (!ipt_phone) {
  67. toastr.error('请填写正确的手机号')
  68. } else if (!/^1[3|4|5|6|7|8|9][0-9]\d{8}$/.test(ipt_phone)) {
  69. toastr.error('请填写正确的手机号')
  70. } else if (!ipt_pass) {
  71. toastr.error('请填写密码')
  72. } else {
  73. $.ajax({
  74. url: 'http://vclusters.imwork.net:2221/api/user/v1/client/getPbKey',
  75. type: 'post',
  76. contentType: "application/json",
  77. dataType: 'json',
  78. cache: false,
  79. success: function (res) {
  80. getPbKey(res.data.publicKey)
  81. }
  82. })
  83. }
  84. }
  85. function getPbKey(publicKey) {
  86. var form = {
  87. phoneNumber: $('#tel_input').val(),
  88. password: getcode(md5($('#tel_pass').val()), publicKey),
  89. client: 5
  90. }
  91. $('.master').show()
  92. $.ajax({
  93. url: 'http://vclusters.imwork.net:2221/api/user/v1/beeMans/fmCloudLogin',
  94. data: JSON.stringify(form),
  95. type: 'post',
  96. contentType: "application/json",
  97. dataType: 'json',
  98. cache: false,
  99. success: function (res) {
  100. $('.master').hide()
  101. if (res.status === 0) {
  102. WebViewJavascriptBridge.callHandler('OpenBridgeKit', res.data)
  103. } else {
  104. toastr.error(res.msg)
  105. }
  106. }
  107. })
  108. }
  109. </script>
  110. </html>