login.jsp 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. <%@page contentType="text/html;charset=UTF-8"%>
  2. <%@include file="/common/taglibs.jsp"%>
  3. <!doctype html>
  4. <html lang="en">
  5. <head>
  6. <%@include file="/common/meta.jsp"%>
  7. <title><spring:message code="core.login.title" text="登录"/></title>
  8. <%@include file="/common/s3.jsp"%>
  9. <script type="text/javascript">
  10. $(function() {
  11. focusTenant();
  12. });
  13. function focusTenant() {
  14. if (document.f.tenant.value == '') {
  15. document.f.tenant.focus();
  16. } else {
  17. focusUsername();
  18. }
  19. }
  20. function focusUsername() {
  21. if (document.f.j_username.value == '') {
  22. document.f.j_username.focus();
  23. } else {
  24. document.f.j_password.focus();
  25. }
  26. }
  27. </script>
  28. <style>
  29. html{width:100%;
  30. height:100%}
  31. body{
  32. background-image: url(${tenantPrefix}/s/images/login_bg.jpg);
  33. background-position: center center;
  34. background-size:cover;
  35. background-repeat: no-repeat;
  36. width: 100%;
  37. height: 100%;
  38. position: relative;
  39. }
  40. .row{
  41. width: 100%;
  42. }
  43. .logincenter{
  44. width:604px;
  45. position: absolute;
  46. top:50%;
  47. left: 50%;
  48. -webkit-transform: translate(-50%,-50%);
  49. -moz-transform: translate(-50%,-50%);
  50. -ms-transform: translate(-50%,-50%);
  51. -o-transform: translate(-50%,-50%);
  52. transform: translate(-50%,-50%);
  53. background-color: rgba(255,255,255,.38);
  54. box-shadow: 0 0 20px 0 rgba(0,0,0,0.29);
  55. border-radius: 10px;
  56. }
  57. .panel{
  58. background-color: transparent;
  59. border: 0;
  60. }
  61. .logincenter>div{
  62. width: 50%;
  63. margin: auto;
  64. position: relative;
  65. }
  66. .login_login{
  67. display: -webkit-box;
  68. display: -webkit-flex;
  69. display: -ms-flexbox;
  70. display: flex;
  71. align-items: flex-end;
  72. font-size: 12px;
  73. color: #0093D2;
  74. line-height: 12px;
  75. justify-content: center;
  76. margin: 40px auto 20px;
  77. }
  78. .login_login>span{
  79. margin-left: 5px;
  80. }
  81. .group_1{
  82. background-color: #fff;
  83. width: 100%;
  84. height: 36px;
  85. border-radius: 3px;
  86. display: -webkit-box;
  87. display: -webkit-flex;
  88. display: -ms-flexbox;
  89. display: flex;
  90. align-items: center;
  91. margin-bottom: 20px;
  92. }
  93. .group_1>label{
  94. padding-top:0px!important;
  95. text-align: center!important;
  96. width: 50px;
  97. }
  98. .group_1>hr{
  99. width: 1px;
  100. height: 12px;
  101. background-color: #ccc;
  102. margin: 0;
  103. }
  104. .group_1 input{
  105. border: 0;
  106. background-color: transparent;
  107. outline: none;
  108. box-shadow: none;
  109. }
  110. .group_1 input:focus{
  111. box-shadow: none;
  112. }
  113. .group_2{
  114. display: -webkit-box;
  115. display: -webkit-flex;
  116. display: -ms-flexbox;
  117. display: flex;
  118. align-items:flex-start;
  119. margin-bottom: 45px;
  120. }
  121. .group_2 label{
  122. padding-top:0px!important;
  123. margin-right: 16px;
  124. font-size: 11px!important;
  125. margin: 0;
  126. }
  127. input:-webkit-autofill {
  128. -webkit-box-shadow: 0 0 0px 1000px white inset;
  129. /*border: 1px solid #CCC!important;*/
  130. }
  131. input:-webkit-autofill:focus{
  132. -webkit-box-shadow: 0 0 0px 1000px white inset;
  133. }
  134. .form-horizontal .form-group{
  135. margin-right: 0px;
  136. margin-left: 0px;
  137. }
  138. .btn{
  139. font-size: 16px;
  140. color: #FFFFFF;
  141. }
  142. </style>
  143. </head>
  144. <body>
  145. <!-- start of header bar -->
  146. <%--<div class="navbar navbar-default navbar-fixed-top lanlan">--%>
  147. <%--<div class="container-fluid">--%>
  148. <%--<div class="navbar-header">--%>
  149. <%--<a class="navbar-brand" href="${tenantPrefix}">--%>
  150. <%--<img src="${tenantPrefix}/s/logo32.png" class="img-responsive pull-left" style=" ;margin-right:5px;">--%>
  151. <%--<sub><small>1.7.0</small></sub>--%>
  152. <%--</a>--%>
  153. <%--</div>--%>
  154. <%--<div class="navbar-collapse collapse">--%>
  155. <%--<ul class="nav navbar-nav navbar-right">--%>
  156. <%--<li>--%>
  157. <%--<a href="?locale=zh_CN"><img src="${ctx}/s/flags/china.gif" height="20"></a>--%>
  158. <%--</li>--%>
  159. <%--<li>--%>
  160. <%--<a href="?locale=en_US"><img src="${ctx}/s/flags/us.gif" height="20"></a>--%>
  161. <%--</li>--%>
  162. <%--</ul>--%>
  163. <%--</div>--%>
  164. <%--</div>--%>
  165. <%--</div>--%>
  166. <!-- end of header bar -->
  167. <div class="row">
  168. <div class="container-fluid">
  169. <div class="col-md-4"></div>
  170. <!-- start of main -->
  171. <section class="logincenter">
  172. <div>
  173. <div class="login_login">
  174. <img src="${ctx}/s/images/login_logo.png" alt="">
  175. <%--<span>V1.0.7</span>--%>
  176. </div>
  177. <div class="alert alert-danger" role="alert" ${param.error==true ? '' : 'style="display:none"'}>
  178. <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
  179. <strong><spring:message code="core.login.failure" text="登陆失败"/></strong>
  180. &nbsp;
  181. ${sessionScope['SPRING_SECURITY_LAST_EXCEPTION'].message}
  182. </div>
  183. <article class="panel panel-default">
  184. <%--<header class="panel-heading">--%>
  185. <%--<spring:message code="core.login.title" text="登录"/>--%>
  186. <%--</header>--%>
  187. <div class="panel-body">
  188. <form id="userForm" name="f" method="post" action="${tenantPrefix}/j_spring_security_check" class="form-horizontal">
  189. <div class="form-group" style="display:none">
  190. <label class="col-md-2 control-label" for="tenant">租户</label>
  191. <div class="col-md-10">
  192. <input type='text' id="tenant" name='tenant' class="form-control" value="${empty sessionScope['SECURITY_LAST_TENANT'] ? cookie['SECURITY_LAST_TENANT'].value : sessionScope['SECURITY_LAST_TENANT']}">
  193. <span id="tenantText" class="glyphicon glyphicon-remove form-control-feedback" aria-hidden="true" style="right:15px;cursor:pointer;pointer-events:auto;display:none;"></span>
  194. </div>
  195. </div>
  196. <div class="form-group group_1" >
  197. <label class="control-label" for="username"><spring:message code="core.login.username" text=""/>
  198. <img src="${ctx}/s/images/login_icon_yonghu.png" alt="">
  199. </label>
  200. <hr/>
  201. <div class="">
  202. <input type='text' id="username" name='j_username' placeholder="请输入用户名" class="form-control" value="${empty sessionScope['SECURITY_LAST_USERNAME'] ? cookie['SECURITY_LAST_USERNAME'].value : sessionScope['SECURITY_LAST_USERNAME']}" aria-describedby="inputSuccess3Status">
  203. <span id="usernameText" class="glyphicon glyphicon-remove form-control-feedback" aria-hidden="true" style="right:15px;cursor:pointer;pointer-events:auto;display:none;"></span>
  204. </div>
  205. </div>
  206. <div class="form-group group_1">
  207. <label class="control-label" for="password"><spring:message code="core.login.password" text=""/>
  208. <img src="${ctx}/s/images/login_icon_mima.png" alt="">
  209. </label>
  210. <hr/>
  211. <div class="">
  212. <input type='password' id="password" name='j_password' class="form-control" value='' placeholder="请输入密码">
  213. </div>
  214. </div>
  215. <c:if test="${sessionScope['captchaSessionToken']}">
  216. <div class="form-group" id="captchaArea">
  217. <label class="col-md-2 control-label" for="password" style="padding-left:0px;">验证码</label>
  218. <div class="col-md-2">
  219. <img id="captchaPicture" src="captcha.jsp?_=<%=System.currentTimeMillis()%>" onclick="this.src='captcha.jsp?_=' + new Date().getTime()">
  220. </div>
  221. <div class="col-md-8">
  222. <input type='text' id="captcha" name='captcha' class="form-control" value=''>
  223. </div>
  224. </div>
  225. </c:if>
  226. <div class="form-group group_2">
  227. <label class=" control-label" for="_spring_security_remember_me">
  228. <img src="${ctx}/s/images/login_icon_zidong.png" class="wei" alt="">
  229. </label>
  230. <input type='checkbox' onchange="changeChecked(this)" style="display: none" name='_spring_security_remember_me' id="_spring_security_remember_me" />
  231. <label for="_spring_security_remember_me" style="margin-left: 16px;">两周内自动登陆</label>
  232. </div>
  233. <div class="form-group">
  234. <div >
  235. <input class="btn btn-primary btn-block" name="submit" type="submit" value="<spring:message code='core.login.submit' text='登 录'/>"/>
  236. </div>
  237. </div>
  238. </form>
  239. </div>
  240. </article>
  241. <div class="m-spacer"></div>
  242. </div>
  243. </section>
  244. <!-- end of main -->
  245. <div class="col-md-4"></div>
  246. </div>
  247. </div>
  248. </body>
  249. </html>
  250. <script>
  251. function changeChecked(e) {
  252. if($(e).attr("checked")=="checked"){
  253. $(".wei").attr("src","${ctx}/s/images/login_icon_zidong_pre.png")
  254. }
  255. else{
  256. $(".wei").attr("src","${ctx}/s/images/login_icon_zidong.png")
  257. }
  258. }
  259. </script>