login.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable">
  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. }
  14. </script>
  15. <script src="/static/js/jquery.min.js?v=2.1.4"></script>
  16. <script src="/static/js/bootstrap.min.js?v=3.3.6"></script>
  17. <script src="/static/js/plugins/layer/layer.js"></script>
  18. <script src="/static/js/common/Feng.js"></script>
  19. <script src="/static/js/common/ajax-object.js"></script>
  20. <style>
  21. .bg{
  22. background: url(/static/img/yjqx.png);
  23. }
  24. input:-webkit-autofill { box-shadow: 0 0 0px 1000px white inset;}
  25. #pwd-form .row{
  26. padding-top: 10px;
  27. }
  28. a,a:hover{color:#000;}
  29. .header,.footer{height:80px;width:100%;background:#fff;}
  30. .header .content{width:980px;height:100%;margin:0 auto;}
  31. .header .content .title{color:#000;font-size:24px;font-weight:bold;line-height:40px;padding:20px 10px;}
  32. .footer{line-height:60px;text-align:center;margin:0;}
  33. .body{background:url(/static/img/login_bg.jpg) no-repeat center;background-size:100% auto;min-height:500px;height:calc(100% - 160px);}
  34. .body .content{width:980px;margin:0 auto;height:100%;position:relative;}
  35. .loginForm{
  36. position:absolute;top:50%;right:20px;margin-top:-225px;width:360px;height:450px;background:#fff;padding:20px;border-radius:10px;
  37. }
  38. .loginForm .greeting{color:#33a1ff;font-size:24px;font-weight:bold;letter-spacing:5px;text-align:center;height:60px;line-height:60px;border-bottom:1px solid #ddd;margin:0 50px;}
  39. .bg1{background-size:auto 100%;}
  40. button[type=submit],button[type=submit]:hover{background:#3073d5;}
  41. button[type=submit]:active{background:#5F9BEE !important;}
  42. @media screen and (max-width:480px){
  43. .header .content{width:400px;}
  44. .body .content{width:400px;}
  45. }
  46. </style>
  47. </head>
  48. <body class="gray-bg">
  49. <div class="header">
  50. <div class="content">
  51. <div class="title">晋江市人才综合服务平台</div>
  52. </div>
  53. </div>
  54. <div class="body" id="body">
  55. <div class="content">
  56. <div class="loginForm">
  57. <div class="greeting">
  58. 欢迎登录
  59. </div>
  60. <form id="login_form" class="m-t" role="form" action="/index/auth/login" method="post">
  61. <div style="color:red;height:20px;margin-bottom:5px;text-align:center;">{$msg}</div>
  62. <div class="form-group bg" >
  63. <select name="usertype" id="userType" class="form-control" placeholder="用户类型" required="">
  64. <option value="">--- 请选择用户类型 ---</option>
  65. <option value="1">管理员用户</option>
  66. <option value="2">机构用户</option>
  67. <!--<option value="3">个人用户</option>-->
  68. </select>
  69. </div>
  70. <div class="form-group">
  71. <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;">
  72. </div>
  73. <div class="form-group">
  74. <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;">
  75. </div>
  76. {if condition="session('captcha') == 1"}
  77. <div class="form-group" style="float: left;">
  78. <div class="col-sm-8" style="padding-left: 0px; padding-right: 0px;">
  79. <input class="form-control" type="text" name="kaptcha" placeholder="验证码" required="">
  80. </div>
  81. <div class="col-sm-4" style="padding-left: 0px; padding-right: 0px;">
  82. <img src="{:captcha_src()}" id="kaptcha" width="100%" height="100%"/>
  83. </div>
  84. </div>
  85. {/if}
  86. <div class="form-group" style="float: left;">
  87. <div class="checkbox" style="text-align: left">
  88. <label>
  89. <input type="checkbox" name="remember" style="margin-top: 2px;">记住我
  90. </label>
  91. </div>
  92. </div>
  93. <button type="submit" class="btn btn-primary block full-width m-b">登录</button>
  94. <div style="margin-top:20px;">
  95. <button onclick="Login.openEditPassword()" type="button" style="border:none;background: #fff;float:left;color: #008ef9;color:#888;">忘记密码?</button>
  96. <button onclick="Login.gotoRegisterPage('/common/auth/register')" type="button" style="border:none; background: #fff;color: #008ef9;float:right;">注册新用户</button>
  97. </div>
  98. </form>
  99. </div>
  100. </div>
  101. </div>
  102. <div class="footer">
  103. <a>Copyight@ 晋江市人才办 All Rights Reserved </a>
  104. </div>
  105. <iframe id="hiddenIframe" name="hiddenIframe" style="display: none;"></iframe>
  106. <script>
  107. resize();
  108. window.onresize = function () {
  109. resize();
  110. }
  111. function resize() {
  112. var height = document.body.clientHeight - 160;
  113. var width = document.body.clientWidth;
  114. var ratio = height / width;
  115. var loginBgRatio = 862 / 1920;
  116. var oldClass = document.querySelector('#body').className;
  117. var classes = oldClass.split(" ");
  118. console.log(ratio, loginBgRatio)
  119. if (ratio > loginBgRatio) {
  120. if (classes.indexOf("bg1") == -1) {
  121. classes.push("bg1");
  122. }
  123. } else {
  124. var index = classes.indexOf("bg1");
  125. if (index > -1) {
  126. classes.splice(index, 1);
  127. }
  128. }
  129. document.querySelector('#body').className = classes.join(" ");
  130. }
  131. </script>
  132. <script>
  133. Feng.addCtx("");
  134. $(function () {
  135. sessionStorage.removeItem('locked');
  136. $("#kaptcha").on('click', function () {
  137. $("#kaptcha").attr('src', '/kaptcha?' + Math.floor(Math.random() * 100)).fadeIn();
  138. });
  139. //获取链接参数
  140. var param = window.location.search;
  141. var userType = Feng.getUrlValue("userType");
  142. var username = Feng.getUrlValue("username");
  143. var name = Feng.getUrlValue("name");
  144. var idCard = Feng.getUrlValue("idCard");
  145. var type = Feng.getUrlValue("type");
  146. if (param != null && param != '' && userType != null && userType != null && username != null && username != null
  147. && name != null && name != '' && idCard != null && idCard != '') {
  148. Login.gotoRegisterPage('/api/common/gotoRegisterPage' + param);
  149. }
  150. });
  151. var Login = {layerIndex: -1};
  152. Login.gotoRegisterPage = function (url) {
  153. var index = layer.open({
  154. type: 2,
  155. title: '注册新用户',
  156. area: ['950px', '700px'], //宽高
  157. fix: false, //不固定
  158. maxmin: true,
  159. content: Feng.ctxPath + url,
  160. btn: ['<i class="fa fa-check"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;取消'],
  161. yes: function (index, layero) {
  162. var iframeWin = window[layero.find('iframe')[0]['name']];
  163. //按钮【按钮一】的回调
  164. iframeWin.Register.addSubmit();
  165. }
  166. });
  167. layer.full(index);
  168. this.layerIndex = index;
  169. }
  170. Login.openEditPassword = function () {
  171. var index = layer.open({
  172. type: 1,
  173. title: '忘记密码',
  174. area: ['550px', '400px'], //宽高
  175. fix: false, //不固定
  176. maxmin: true,
  177. content: '<form id="pwd-form" class="form-horizontal" >\n' +
  178. '<div class="col-sm-12 form-group">\n' +
  179. '<div class="row">\n' +
  180. '<label class="col-sm-3 control-label spacing"><span class="text-danger">*</span>账号类型</label>\n' +
  181. '<div class="col-sm-9 spacing">\n' +
  182. '<select type="text" class="form-control" id="type" name="type" >' +
  183. '<option value="">请选择</option>' +
  184. '<option value="1">企业账户</option>' +
  185. '<option value="2">个人账户</option>' +
  186. '</select>\n' +
  187. '</div>\n' +
  188. '</div>\n' +
  189. '<div class="row">\n' +
  190. '<label class="col-sm-3 control-label spacing"><span class="text-danger">*</span>账号</label>\n' +
  191. '<div class="col-sm-9 spacing">\n' +
  192. '<input type="text" autocomplete="off" class="form-control" id="username" name="username" />\n' +
  193. '</div>\n' +
  194. '</div>\n' +
  195. '<div class="row">\n' +
  196. '<label class="col-sm-3 control-label spacing"><span class="text-danger">*</span>新密码</label>\n' +
  197. '<div class="col-sm-9 spacing">\n' +
  198. '<input type="password" autocomplete="off" class="form-control" id="password" name="password" />\n' +
  199. '</div>\n' +
  200. '</div>\n' +
  201. '<div class="row">\n' +
  202. '<label class="col-sm-3 control-label spacing"><span class="text-danger">*</span>重复新密码</label>\n' +
  203. '<div class="col-sm-9 spacing">\n' +
  204. '<input autocomplete="off" type="password" class="form-control" id="re_password" />\n' +
  205. '</div>\n' +
  206. '</div>\n' +
  207. '<div class="row">\n' +
  208. '<label class="col-sm-3 control-label spacing"><span class="text-danger">*</span>手机号</label>\n' +
  209. '<div class="col-sm-9 spacing form-inline">\n' +
  210. '<input autocomplete="off" type="text" style="width: 250px;" class="form-control" id="phone" name="phone" placeholder="企业账号请填写人才联络员手机号码"/>\n' +
  211. '<button id="smsBtn" style="margin-bottom: 0px;" onclick="Login.sendSms()" type="button" class="btn btn-xs btn-info">获取验证码</button>\n' +
  212. '</div>\n' +
  213. '</div>\n' +
  214. '<div class="row">\n' +
  215. '<label class="col-sm-3 control-label spacing"><span class="text-danger">*</span>手机验证码</label>\n' +
  216. '<div class="col-sm-9 spacing">\n' +
  217. '<input autocomplete="off" type="text" class="form-control" id="verificationCode" name="verificationCode" />\n' +
  218. '</div>\n' +
  219. '</div>\n' +
  220. '</div>\n' +
  221. '</form>',
  222. btn: ['<i class="fa fa-check"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;取消'],
  223. btnAlign: 'c',
  224. yes: function (index, layero) {
  225. var type = $("#type").val();
  226. var username = $("#username").val();
  227. var password = $("#password").val();
  228. var rePassword = $("#re_password").val();
  229. var phone = $("#phone").val();
  230. var verificationCode = $("#verificationCode").val();
  231. if (type == null || type == "") {
  232. Feng.info("请选择账号类型!");
  233. return;
  234. }
  235. if (username == null || username == '') {
  236. Feng.info("请填写账号名!");
  237. return;
  238. }
  239. if (password == null || password == '') {
  240. Feng.info("请填写密码!");
  241. return;
  242. }
  243. if (rePassword == null || rePassword == '') {
  244. Feng.info("请填写重复密码!");
  245. return;
  246. }
  247. if (password != rePassword) {
  248. Feng.info("两次密码填写不一致!");
  249. return;
  250. }
  251. if (phone == null || phone == '') {
  252. Feng.info("请填写手机号!");
  253. return;
  254. }
  255. if (verificationCode == null || verificationCode == '') {
  256. Feng.info("请填写手机验证码!");
  257. return;
  258. }
  259. if (!/0?(13|14|15|17|18|19)[0-9]{9}/.test(phone)) {
  260. Feng.info("手机号格式不合法!");
  261. return;
  262. }
  263. var da = {"type": type, "username": username, "password": password, "rePassword": rePassword, "phone": phone, "verificationCode": verificationCode};
  264. var ajax = new $ax(Feng.ctxPath + "/common/auth/findBackPassword", function (data) {
  265. Feng.info(data.msg);
  266. if (data.code == 200) {
  267. layer.close(index);
  268. }
  269. }, function (data) {
  270. Feng.error("操作失败!" + data.responseJSON.message + "!");
  271. });
  272. ajax.set(da);
  273. ajax.start();
  274. }
  275. });
  276. }
  277. var countDown = 0;
  278. Login.sendSms = function () {
  279. var phone = $("#phone").val();
  280. if (phone == null || phone == "") {
  281. Feng.info("请填写手机号!");
  282. return;
  283. }
  284. phone = $.trim(phone);
  285. if (!Feng.checkMobilePhoneNum(phone)) {
  286. Feng.info("手机号格式有误,请填写正确的手机号码!");
  287. return;
  288. }
  289. Login.BtnCountDown();
  290. var ajax = new $ax(Feng.ctxPath + "/common/auth/verificationCode?phone=" + phone + "&type=1", function (data) {
  291. Feng.info(data.msg);
  292. }, function (data) {
  293. Feng.error("操作失败!" + data.responseJSON.message + "!");
  294. });
  295. ajax.set(null);
  296. ajax.start();
  297. }
  298. Login.BtnCountDown = function () {
  299. if (countDown == 0) {
  300. countDown = 60;
  301. } else if (countDown == 1) {
  302. $("#smsBtn").removeAttr("disabled");
  303. $("#smsBtn").html("获取验证码");
  304. countDown = 0;
  305. return;
  306. }
  307. $("#smsBtn").attr("disabled", true);
  308. $("#smsBtn").html(countDown + "秒");
  309. countDown--;
  310. setTimeout("Login.BtnCountDown()", 1000);
  311. }
  312. Login.callBack = function (data) {
  313. }
  314. </script>
  315. </body>
  316. </html>