login.html 17 KB

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