login.jsp 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%@page import="org.jeecgframework.core.util.SysThemesUtil,org.jeecgframework.core.enums.SysThemesEnum"%>
  3. <%@include file="/context/mytags.jsp"%>
  4. <%
  5. session.setAttribute("lang","zh-cn");
  6. SysThemesEnum sysTheme = SysThemesUtil.getSysTheme(request);
  7. String lhgdialogTheme = SysThemesUtil.getLhgdialogTheme(sysTheme);
  8. %>
  9. <!DOCTYPE html>
  10. <html lang="zh-cn">
  11. <head>
  12. <meta charset="utf-8" />
  13. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  14. <meta http-equiv="Cache-Control" content="no-siteapp"/>
  15. <meta name="renderer" content="webkit" />
  16. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
  17. <meta name="description" content="JEECG BPM" />
  18. <meta name="keywords" content="JEECG BPM" />
  19. <title>JEECG BPM 登录</title>
  20. <link rel="stylesheet" type="text/css" href="plug-in/planeui/dist/css/planeui.css" />
  21. <link rel="stylesheet" type="text/css" href="plug-in/planeui/login/css/login.css" />
  22. </head>
  23. <body>
  24. <!--[if lte IE 9]>
  25. <div class="pui-layout pui-browsehappy">
  26. <a href="javascript:;" class="pui-close" onclick="document.body.removeChild(this.parentNode);"></a>
  27. <p>您正在使用 <strong class="pui-text-yellow pui-text-xl">过时</strong> 的非现代浏览器,<strong class="pui-text-success pui-text-xl">91.23%</strong> 的人选择 <a href="http://browsehappy.com/" target="_blank" class="pui-text-green-400 pui-text-xl"><strong>升级浏览器</strong></a>,获得了更好、更安全的浏览体验!</p>
  28. </div>
  29. <![endif]-->
  30. <a name="top"></a>
  31. <div class="pui-layout pui-flexbox pui-flex-column login-layout">
  32. <div class="pui-layout pui-flex login-main">
  33. <div class="pui-layout pui-layout-fixed pui-layout-fixed-1200 login-main-con">
  34. <div class="login-panel">
  35. <form name="formLogin" id="formLogin" class="pui-form login-form" action="mLoginController.do?login" check="mLoginController.do?checkuser" method="post">
  36. <div class="pui-form-group">
  37. <h1 class="pui-text-white pui-text-normal">
  38. <i class="planeui-logo-2x pui-text-xxxxxl"></i>BPM登录
  39. </h1>
  40. <div role="username">
  41. <input type="text" name="userName" id="userName" class="pui-unbordered" placeholder="用户名" value="ceshi"/>
  42. <i class="fa fa-user pui-text-blue"></i>
  43. </div>
  44. </div>
  45. <div class="pui-form-group">
  46. <div role="password">
  47. <input type="password" name="password" id="password" class="pui-unbordered" placeholder="密码" value="123456"/>
  48. <i class="fa fa-lock pui-text-blue"></i>
  49. </div>
  50. </div>
  51. <div class="pui-form-group">
  52. <div role="vcode">
  53. <input type="text" name="randCode" id="randCode" maxlength="4" class="pui-unbordered" placeholder="验证码" />
  54. <i class="fa fa-shield pui-text-blue"></i>
  55. <img src="randCodeImage" id="vcode-img" />
  56. </div>
  57. </div>
  58. <div class="pui-form-group">
  59. <input id="but_login" type="button" name="but_login" onclick="checkUser()" class="pui-btn pui-btn-default pui-bg-blue-800 pui-unbordered" value="登录" />
  60. <input id="forgetpass" type="button" name="forgetpass" class="pui-btn pui-btn-default pui-bg-blue-800 pui-unbordered" value="重置" />
  61. <span><a href="#" class="pui-text-white pui-text-xs">忘记密码?</a></span>
  62. </div>
  63. </form>
  64. </div>
  65. </div>
  66. </div>
  67. </div>
  68. <!--[if (gte IE 9) | !(IE)]><!-->
  69. <script type="text/javascript" src="plug-in/jquery/jquery-2.1.1.min.js"></script>
  70. <!--<![endif]-->
  71. <!--[if lt IE 9]>
  72. <script type="text/javascript" src="plug-in/jquery/jquery-1.11.3.min.js"></script>
  73. <script type="text/javascript" src="plug-in/planeui/dist/js/planeui.patch.ie8.js"></script>
  74. <![endif]-->
  75. <!--[if lt IE 10]>
  76. <script type="text/javascript" src="plug-in/planeui/dist/js/planeui.patch.ie9.js"></script>
  77. <![endif]-->
  78. <script type="text/javascript" src="plug-in/planeui/dist/js/planeui.js"></script>
  79. <script type="text/javascript">
  80. function showErrorMsg(msg){
  81. $.dialog({
  82. type:"alert-app",
  83. content : msg,
  84. buttons : {
  85. style : {
  86. //yes : "color:red;"
  87. },
  88. "class" : {
  89. //yes : "pui-btn-warning"
  90. }
  91. },
  92. yes : function(){
  93. }
  94. });
  95. }
  96. //回车登录
  97. $(document).keydown(function(e){
  98. if(e.keyCode == 13) {
  99. checkUser();
  100. }
  101. });
  102. //update-begin--Author:zhangguoming Date:20140226 for:添加验证码
  103. $('#vcode-img').click(function(){
  104. reloadRandCodeImage();
  105. });
  106. /**
  107. * 刷新验证码
  108. */
  109. function reloadRandCodeImage() {
  110. var date = new Date();
  111. $("#vcode-img").attr("src",'randCodeImage?a=' + date.getTime());
  112. }
  113. //验证用户信息
  114. function checkUser(){
  115. if(!validForm()){
  116. return false;
  117. }
  118. Login();
  119. }
  120. //表单验证
  121. function validForm(){
  122. if($.trim($("#userName").val()).length==0){
  123. showErrorMsg("请输入用户名");
  124. return false;
  125. }
  126. if($.trim($("#password").val()).length==0){
  127. showErrorMsg("请输入密码");
  128. return false;
  129. }
  130. if($.trim($("#randCode").val()).length==0){
  131. showErrorMsg("请输入验证码");
  132. return false;
  133. }
  134. return true;
  135. }
  136. //登录处理函数
  137. function Login(orgId) {
  138. //setCookie();
  139. var actionurl=$('form').attr('action');//提交路径
  140. var checkurl=$('form').attr('check');//验证路径
  141. var formData = new Object();
  142. var data=$(":input").each(function() {
  143. formData[this.name] =$("#"+this.name ).val();
  144. });
  145. formData['orgId'] = orgId ? orgId : "";
  146. // update-begin--Author:ken Date:20140629 for:添加语言选择
  147. //formData['langCode']=$("#langCode").val();
  148. // update-end--Author:ken Date:20140629 for:添加语言选择
  149. //formData['langCode'] = $("#langCode option:selected").val();
  150. var loading = $.dialog({
  151. type: "loading",
  152. maskClickClosed : false,
  153. toolbar: false,
  154. content : '<div class="pui-loading pui-loading-ring"></div><p style="margin-top:10px;">正在登录中,请稍后....</p>'
  155. });
  156. jQuery.ajax({
  157. type : 'POST',
  158. url : checkurl,// 请求的action路径
  159. data : formData,
  160. error : function() {// 请求失败处理函数
  161. },
  162. success : function(data) {
  163. var d = data; // ------ $.parseJSON(data);
  164. if (d.success) {
  165. //loginsuccess();
  166. window.location.href=actionurl;
  167. }else{
  168. loading.hide();
  169. showErrorMsg(d.msg);
  170. }
  171. }
  172. });
  173. }
  174. </script>
  175. </body>
  176. </html>