login.html 17 KB

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