login.jsp 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
  3. <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
  4. <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
  5. <%
  6. String path = request.getContextPath();
  7. String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort() + path+"/";
  8. request.setAttribute("contextPath", basePath);
  9. String redirectUrl= request.getParameter("redirectUrl");
  10. request.setAttribute("redirectUrl", redirectUrl);
  11. %>
  12. <!DOCTYPE html>
  13. <html lang="en">
  14. <head>
  15. <base href="<%=basePath%>">
  16. <meta charset="UTF-8">
  17. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  18. <meta name="apple-mobile-web-app-capable" content="yes">
  19. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  20. <meta name="format-detection" content="telephone=no">
  21. <title>登录</title>
  22. <c:set var="path" value="${pageContext.request.contextPath}" />
  23. <script src="${contextPath }app/lib/flexible.js"></script>
  24. <script type="text/javascript" src="${contextPath }res/js/jquery.min.js"></script>
  25. <script type="text/javascript" src="${contextPath }res/js/layer/layer.min.js"></script>
  26. <script type="text/javascript" src="${contextPath }app/js/aes.js"></script>
  27. <link rel="stylesheet" href="${contextPath }app/lib/flexible.css">
  28. <link rel="stylesheet" href="${contextPath }app/css/basem.css">
  29. <link rel="stylesheet" href="${contextPath }app/css/logome.css">
  30. <script type="text/javascript">
  31. $(function(){
  32. $('#btnLogin').click(function(){
  33. var username=$("input[name='username']").val();
  34. var password=$("input[name='password']").val();
  35. if(username=='' || password== '' ){
  36. layer.msg("用户名和密码必须输入!");
  37. return false;
  38. }
  39. $.post('${contextPath}web/mgmUserCtl/ajaxLogin.cs', {
  40. "username" : username,
  41. "password" : password
  42. }, function(data) {
  43. var datas=eval(data.data);
  44. if (data.ret == 1) {
  45. //集团用户
  46. if(datas.type=="0"){
  47. //首次登陆跳转手机绑定
  48. if(datas.firstLogin=="0"){
  49. window.location.href = '${contextPath}web/mgmUserCtl/phone_bang.cs?userId='+datas.id;
  50. }else{
  51. window.location.href = '${contextPath}web/mgmUserCtl/index.cs?userId='+datas.id;
  52. }
  53. //非集团用户
  54. }else{
  55. //首次身份认证
  56. if(datas.idnumber=="" || datas.idnumber==null){
  57. window.location.href = '${contextPath}web/mgmUserCtl/info_personal.cs?userId='+datas.id+'&phone='+datas.phone;
  58. }else{
  59. window.location.href = '${contextPath}web/mgmUserCtl/index.cs?userId='+datas.id;
  60. }
  61. }
  62. }else{
  63. layer.msg(data.msg);
  64. }
  65. }, "json");
  66. });
  67. });
  68. </script>
  69. </head>
  70. <body>
  71. <div class="logbox">
  72. <div class="safe">
  73. <div class="logobg">
  74. <img class="logo" src="${contextPath }app/img/logo@2x.png" alt="">
  75. <h2>欢迎您!</h2>
  76. <%-- <form id="loginForm" action="<%=basePath%>web/mgmUserCtl/ajaxLogin.cs" method="post"> --%>
  77. <ul class="logul">
  78. <li>
  79. <div><img class="logicon" src="${contextPath }app/img/iphone@2x.png" alt=""><span>账号</span></div>
  80. <input name="username" type="text" placeholder="请输入工号或手机号">
  81. </li>
  82. <li>
  83. <div><img class="logicon" src="${contextPath }app/img/pw@2x.png" alt=""><span>密码</span></div>
  84. <input name="password" id="password" type="password" placeholder="请输入密码">
  85. </li>
  86. </ul>
  87. <div id="button">
  88. <a class="redbtn" href="javascript:void(0);" id="btnLogin">登录</a>
  89. </div>
  90. <div class="loga">
  91. <a class="left" href="${contextPath }app/login/forget.jsp">忘记密码</a>
  92. <a class="right" href="${contextPath }app/login/register.jsp">立即注册</a>
  93. </div>
  94. <!-- </form> -->
  95. </div>
  96. </div>
  97. </div>
  98. </body>
  99. </html>