login.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>晋江市人才综合服务平台-登录</title>
  7. <link rel="shortcut icon" href="/static/favicon.ico">
  8. <link href="/static/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
  9. <link href="/static/css/font-awesome.css?v=4.4.0" rel="stylesheet">
  10. <link href="/static/css/style.css?v=4.1.0" rel="stylesheet">
  11. <script>if (window.top !== window.self) {
  12. window.top.location = window.location;
  13. }</script>
  14. <script src="/static/js/jquery.min.js?v=2.1.4"></script>
  15. <script src="/static/js/bootstrap.min.js?v=3.3.6"></script>
  16. <script src="/static/js/plugins/layer/layer.js"></script>
  17. <script src="/static/js/common/Feng.js"></script>
  18. <script src="/static/js/common/ajax-object.js"></script>
  19. <style>
  20. .bg{
  21. background: url(/static/img/yjqx.png);
  22. }
  23. input:-webkit-autofill { box-shadow: 0 0 0px 1000px white inset;}
  24. #pwd-form .row{
  25. padding-top: 10px;
  26. }
  27. </style>
  28. </head>
  29. <body class="gray-bg" style="background: url(/static/img/login3.jpg) no-repeat center; overflow: hidden;min-width:1200px;">
  30. <div class="middle-box text-center loginscreen" style=" margin-left: 51%;margin-top: 11%;">
  31. <br/>
  32. <form style="position:absolute;top:35%;margin:0 auto;width:300px;" id="login_form" class="m-t" role="form" action="/index/auth/login" method="post">
  33. <h4 style="color: red;">{$msg}</h4>
  34. <div class="form-group bg" >
  35. <select name="usertype" id="userType" class="form-control" placeholder="用户类型" required="">
  36. <option value="">--- 请选择用户类型 ---</option>
  37. <option value="1">管理员用户</option>
  38. <option value="2">企业用户</option>
  39. <option value="3">个人用户</option>
  40. </select>
  41. </div>
  42. <div class="form-group">
  43. <input type="text" name="username" class="form-control" placeholder="用户名" autocomplete="off" required="" style="background: url(/static/img/user.png) 6px 9px no-repeat;padding-left: 25px;">
  44. </div>
  45. <div class="form-group">
  46. <input type="password" name="password" class="form-control" placeholder="密码" autocomplete="off" required="" style="background: url(/static/img/mm.png) 6px 9px no-repeat;padding-left: 25px;">
  47. </div>
  48. <div class="form-group" style="float: left;">
  49. <div class="checkbox" style="text-align: left">
  50. <label>
  51. <input type="checkbox" name="remember" style="margin-top: 2px;">记住我
  52. </label>
  53. </div>
  54. </div>
  55. <button type="submit" class="btn btn-primary block full-width m-b" style="background:url(/static/img/btn.png);height: 34px;"></button>
  56. </p>
  57. <button onclick="Login.gotoRegisterPage('/api/common/gotoRegisterPage')" type="button" style="border:none; background: #fff;color: #008ef9;margin-left: 150px;">注册新用户</button>
  58. <button onclick="Login.openEditPassword()" type="button" style="border:none; background: #fff;float: right;color: #008ef9;">忘记密码</button>
  59. </form>
  60. </div>
  61. <iframe id="hiddenIframe" name="hiddenIframe" style="display: none;"></iframe>
  62. <script>
  63. Feng.addCtx("");
  64. $(function () {
  65. sessionStorage.removeItem('locked');
  66. $("#kaptcha").on('click', function () {
  67. $("#kaptcha").attr('src', '/kaptcha?' + Math.floor(Math.random() * 100)).fadeIn();
  68. });
  69. //获取链接参数
  70. var param = window.location.search;
  71. var userType = Feng.getUrlValue("userType");
  72. var username = Feng.getUrlValue("username");
  73. var name = Feng.getUrlValue("name");
  74. var idCard = Feng.getUrlValue("idCard");
  75. var type = Feng.getUrlValue("type");
  76. if (param != null && param != '' && userType != null && userType != null && username != null && username != null
  77. && name != null && name != '' && idCard != null && idCard != '') {
  78. Login.gotoRegisterPage('/api/common/gotoRegisterPage' + param);
  79. }
  80. });
  81. var Login = {layerIndex: -1};
  82. Login.gotoRegisterPage = function (url) {
  83. var index = layer.open({
  84. type: 2,
  85. title: '注册新用户',
  86. area: ['950px', '700px'], //宽高
  87. fix: false, //不固定
  88. maxmin: true,
  89. content: Feng.ctxPath + url,
  90. btn: ['<i class="fa fa-check"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;取消'],
  91. yes: function (index, layero) {
  92. var iframeWin = window[layero.find('iframe')[0]['name']];
  93. //按钮【按钮一】的回调
  94. iframeWin.Register.addSubmit();
  95. }
  96. });
  97. layer.full(index);
  98. this.layerIndex = index;
  99. }
  100. Login.openEditPassword = function () {
  101. var index = layer.open({
  102. type: 1,
  103. title: '忘记密码',
  104. area: ['550px', '400px'], //宽高
  105. fix: false, //不固定
  106. maxmin: true,
  107. content: '<form id="pwd-form" class="form-horizontal" >\n' +
  108. '<div class="col-sm-12 form-group">\n' +
  109. '<div class="row">\n' +
  110. '<label class="col-sm-3 control-label spacing"><span class="text-danger">*</span>账号类型</label>\n' +
  111. '<div class="col-sm-9 spacing">\n' +
  112. '<select type="text" class="form-control" id="type" name="type" >' +
  113. '<option value="">请选择</option>' +
  114. '<option value="1">企业账户</option>' +
  115. '<option value="2">个人账户</option>' +
  116. '</select>\n' +
  117. '</div>\n' +
  118. '</div>\n' +
  119. '<div class="row">\n' +
  120. '<label class="col-sm-3 control-label spacing"><span class="text-danger">*</span>账号</label>\n' +
  121. '<div class="col-sm-9 spacing">\n' +
  122. '<input type="text" autocomplete="off" class="form-control" id="username" name="username" />\n' +
  123. '</div>\n' +
  124. '</div>\n' +
  125. '<div class="row">\n' +
  126. '<label class="col-sm-3 control-label spacing"><span class="text-danger">*</span>新密码</label>\n' +
  127. '<div class="col-sm-9 spacing">\n' +
  128. '<input type="password" autocomplete="off" class="form-control" id="password" name="password" />\n' +
  129. '</div>\n' +
  130. '</div>\n' +
  131. '<div class="row">\n' +
  132. '<label class="col-sm-3 control-label spacing"><span class="text-danger">*</span>重复新密码</label>\n' +
  133. '<div class="col-sm-9 spacing">\n' +
  134. '<input autocomplete="off" type="password" class="form-control" id="re_password" />\n' +
  135. '</div>\n' +
  136. '</div>\n' +
  137. '<div class="row">\n' +
  138. '<label class="col-sm-3 control-label spacing"><span class="text-danger">*</span>手机号</label>\n' +
  139. '<div class="col-sm-9 spacing form-inline">\n' +
  140. '<input autocomplete="off" type="text" style="width: 250px;" class="form-control" id="phone" name="phone" placeholder="企业账号请填写经办人手机号码"/>\n' +
  141. '<button id="smsBtn" style="margin-bottom: 0px;" onclick="Login.sendSms()" type="button" class="btn btn-xs btn-info">获取验证码</button>\n' +
  142. '</div>\n' +
  143. '</div>\n' +
  144. '<div class="row">\n' +
  145. '<label class="col-sm-3 control-label spacing"><span class="text-danger">*</span>手机验证码</label>\n' +
  146. '<div class="col-sm-9 spacing">\n' +
  147. '<input autocomplete="off" type="text" class="form-control" id="verificationCode" name="verificationCode" />\n' +
  148. '</div>\n' +
  149. '</div>\n' +
  150. '</div>\n' +
  151. '</form>',
  152. btn: ['<i class="fa fa-check"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;取消'],
  153. btnAlign: 'c',
  154. yes: function (index, layero) {
  155. var type = $("#type").val();
  156. var username = $("#username").val();
  157. var password = $("#password").val();
  158. var rePassword = $("#re_password").val();
  159. var phone = $("#phone").val();
  160. var verificationCode = $("#verificationCode").val();
  161. if (type == null || type == "") {
  162. Feng.info("请选择账号类型!");
  163. return;
  164. }
  165. if (username == null || username == '') {
  166. Feng.info("请填写账号名!");
  167. return;
  168. }
  169. if (password == null || password == '') {
  170. Feng.info("请填写密码!");
  171. return;
  172. }
  173. if (rePassword == null || rePassword == '') {
  174. Feng.info("请填写重复密码!");
  175. return;
  176. }
  177. if (password != rePassword) {
  178. Feng.info("两次密码填写不一致!");
  179. return;
  180. }
  181. if (phone == null || phone == '') {
  182. Feng.info("请填写手机号!");
  183. return;
  184. }
  185. if (verificationCode == null || verificationCode == '') {
  186. Feng.info("请填写手机验证码!");
  187. return;
  188. }
  189. if (!/0?(13|14|15|17|18|19)[0-9]{9}/.test(phone)) {
  190. Feng.info("手机号格式不合法!");
  191. return;
  192. }
  193. var da = {"type": type, "username": username, "password": password, "rePassword": rePassword, "phone": phone, "verificationCode": verificationCode};
  194. var ajax = new $ax(Feng.ctxPath + "/api/common/findBackPassword", function (data) {
  195. Feng.info(data.msg);
  196. if (data.code == 200) {
  197. layer.close(index);
  198. }
  199. }, function (data) {
  200. Feng.error("操作失败!" + data.responseJSON.message + "!");
  201. });
  202. ajax.set(da);
  203. ajax.start();
  204. }
  205. });
  206. }
  207. var countDown = 0;
  208. Login.sendSms = function () {
  209. var phone = $("#phone").val();
  210. if (phone == null || phone == "") {
  211. Feng.info("请填写手机号!");
  212. return;
  213. }
  214. phone = $.trim(phone);
  215. if (!Feng.checkMobilePhoneNum(phone)) {
  216. Feng.info("手机号格式有误,请填写正确的手机号码!");
  217. return;
  218. }
  219. Login.BtnCountDown();
  220. var ajax = new $ax(Feng.ctxPath + "/api/common/verificationCode?phone=" + phone + "&type=1", function (data) {
  221. Feng.info(data.msg);
  222. }, function (data) {
  223. Feng.error("操作失败!" + data.responseJSON.message + "!");
  224. });
  225. ajax.set(null);
  226. ajax.start();
  227. }
  228. Login.BtnCountDown = function () {
  229. if (countDown == 0) {
  230. countDown = 60;
  231. } else if (countDown == 1) {
  232. $("#smsBtn").removeAttr("disabled");
  233. $("#smsBtn").html("获取验证码");
  234. countDown = 0;
  235. return;
  236. }
  237. $("#smsBtn").attr("disabled", true);
  238. $("#smsBtn").html(countDown + "秒");
  239. countDown--;
  240. setTimeout("Login.BtnCountDown()", 1000);
  241. }
  242. Login.callBack = function (data) {
  243. }
  244. </script>
  245. </body>
  246. </html>