login.html 18 KB

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