sysLogin.jsp 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. <%@ page contentType="text/html;charset=UTF-8" %>
  2. <%@ page import="org.apache.shiro.web.filter.authc.FormAuthenticationFilter" %>
  3. <%@ include file="/WEB-INF/views/include/taglib.jsp" %>
  4. <html>
  5. <head>
  6. <title>${fns:getConfig('productName')} 登录</title>
  7. <meta name="decorator" content="blank"/>
  8. <style type="text/css">
  9. html, body, table {
  10. background-color: #f5f5f5;
  11. width: 100%;
  12. text-align: center;
  13. }
  14. .form-signin-heading {
  15. font-family: Helvetica, Georgia, Arial, sans-serif, 黑体;
  16. font-size: 36px;
  17. margin-bottom: 20px;
  18. color: #0663a2;
  19. }
  20. .form-signin {
  21. position: relative;
  22. text-align: left;
  23. width: 300px;
  24. padding: 25px 29px 29px;
  25. margin: 0 auto 20px;
  26. background-color: #fff;
  27. border: 1px solid #e5e5e5;
  28. -webkit-border-radius: 5px;
  29. -moz-border-radius: 5px;
  30. border-radius: 5px;
  31. -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
  32. -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
  33. box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
  34. }
  35. .form-signin .checkbox {
  36. margin-bottom: 10px;
  37. color: #0663a2;
  38. }
  39. .form-signin .input-label {
  40. font-size: 16px;
  41. line-height: 23px;
  42. color: #999;
  43. }
  44. .form-signin .input-block-level {
  45. font-size: 16px;
  46. height: auto;
  47. margin-bottom: 15px;
  48. padding: 7px;
  49. *width: 283px;
  50. *padding-bottom: 0;
  51. _padding: 7px 7px 9px 7px;
  52. }
  53. .form-signin .btn.btn-large {
  54. width: 100%;
  55. height: 40px;
  56. font-size: 14px;
  57. margin-bottom: 10px;
  58. }
  59. .form-signin #themeSwitch {
  60. position: absolute;
  61. right: 15px;
  62. bottom: 10px;
  63. }
  64. .form-signin div.validateCode {
  65. padding-bottom: 15px;
  66. }
  67. .mid {
  68. vertical-align: middle;
  69. }
  70. .header {
  71. height: 80px;
  72. padding-top: 20px;
  73. }
  74. .alert {
  75. position: relative;
  76. width: 300px;
  77. margin: 0 auto;
  78. *padding-bottom: 0px;
  79. }
  80. label.error {
  81. background: none;
  82. width: 270px;
  83. font-weight: normal;
  84. color: inherit;
  85. margin: 0;
  86. }
  87. .verify-wrap {
  88. width: 240px !important;
  89. border-radius: 5px;
  90. margin-bottom: 15px;
  91. }
  92. .fix-tips {
  93. background: -webkit-gradient(linear, left top, right top, color-stop(0, #4d4d4d), color-stop(.4, #4d4d4d), color-stop(.5, #fff), color-stop(.6, #4d4d4d), color-stop(1, #4d4d4d));
  94. -webkit-background-clip: text;
  95. -webkit-text-fill-color: transparent;
  96. -webkit-animation: slidetounlock 3s infinite;
  97. color: #787878 !important;
  98. }
  99. @keyframes slidetounlock {
  100. 0% {
  101. background-position: -100px 0;
  102. }
  103. 100% {
  104. background-position: 100px 0;
  105. }
  106. }
  107. .verify-wrap .drag-btn{
  108. border-radius: 5px;
  109. height: 38px;
  110. top: 0;
  111. left: 0;
  112. }
  113. </style>
  114. <script type="text/javascript">
  115. $(document).ready(function () {
  116. var isSlideFinishState = false;
  117. $('#submitButton').attr('disabled',"true");
  118. var SlideVerifyPlug = window.slideVerifyPlug;
  119. var slideVerify = new SlideVerifyPlug('#verify-wrap', {
  120. wrapWidth: '350',//设置 容器的宽度 ,不设置的话,会设置成100%,需要自己在外层包层div,设置宽度,这是为了适应方便点;
  121. initText: '请向右滑动滑块', //设置 初始的 显示文字
  122. sucessText: '验证通过',//设置 验证通过 显示的文字
  123. getSuccessState: function (res) {
  124. //当验证完成的时候 会 返回 res 值 true,只留了这个应该够用了
  125. console.log(res);
  126. if (slideVerify.slideFinishState) {
  127. $('.value').html(slideVerify.slideFinishState)
  128. $('#resetBtn').removeClass('prohibit')
  129. $('#submitButton').removeAttr("disabled");
  130. isSlideFinishState = true;
  131. }
  132. }
  133. });
  134. $("#loginForm").validate({
  135. rules: {
  136. validateCode: {remote: "${pageContext.request.contextPath}/servlet/validateCodeServlet"}
  137. },
  138. messages: {
  139. username: {required: "请填写用户名."}, password: {required: "请填写密码."},
  140. validateCode: {remote: "验证码不正确.", required: "请填写验证码."}
  141. },
  142. errorLabelContainer: "#messageBox",
  143. errorPlacement: function (error, element) {
  144. error.appendTo($("#loginError").parent());
  145. }
  146. });
  147. });
  148. // 如果在框架或在对话框中,则弹出提示并跳转到首页
  149. if (self.frameElement && self.frameElement.tagName == "IFRAME" || $('#left').length > 0 || $('.jbox').length > 0) {
  150. alert('未登录或登录超时。请重新登录,谢谢!');
  151. top.location = "${ctx}";
  152. }
  153. </script>
  154. </head>
  155. <body>
  156. <!--[if lte IE 6]><br/>
  157. <div class='alert alert-block' style="text-align:left;padding-bottom:10px;"><a class="close" data-dismiss="alert">x</a>
  158. <h4>温馨提示:</h4>
  159. <p>你使用的浏览器版本过低。为了获得更好的浏览体验,我们强烈建议您 <a href="http://browsehappy.com" target="_blank">升级</a> 到最新版本的IE浏览器,或者使用较新版本的
  160. Chrome、Firefox、Safari 等。</p></div><![endif]-->
  161. <div class="header">
  162. <div id="messageBox" class="alert alert-error ${empty message ? 'hide' : ''}">
  163. <button data-dismiss="alert" class="close">×</button>
  164. <label id="loginError" class="error">${message}</label>
  165. </div>
  166. </div>
  167. <h1 class="form-signin-heading">${fns:getConfig('productName')}</h1>
  168. <form id="loginForm" class="form-signin" action="${ctx}/login" method="post">
  169. <label class="input-label" for="username">登录名</label>
  170. <input type="text" id="username" name="username" class="input-block-level required" value="${username}">
  171. <label class="input-label" for="password">密码</label>
  172. <input type="password" id="password" name="password" class="input-block-level required">
  173. <!-- 滑动验证 -->
  174. <div class="verify-wrap" id="verify-wrap"></div>
  175. <c:if test="${isValidateCodeLogin}">
  176. <div class="validateCode">
  177. <label class="input-label mid" for="validateCode">验证码</label>
  178. <sys:validateCode name="validateCode" inputCssStyle="margin-bottom:0;"/>
  179. </div>
  180. </c:if>
  181. <%--
  182. <label for="mobile" title="手机登录"><input type="checkbox" id="mobileLogin" name="mobileLogin" ${mobileLogin ? 'checked' : ''}/></label> --%>
  183. <button class="btn btn-large btn-primary" type="submit" id="submitButton">登录</button>
  184. <%--<label for="rememberMe" title="下次不需要再登录"><input type="checkbox" id="rememberMe" name="rememberMe" ${rememberMe ? 'checked' : ''}/> 记住我(公共场所慎用)</label>--%>
  185. <div id="themeSwitch" class="dropdown">
  186. <a class="dropdown-toggle" data-toggle="dropdown"
  187. href="#">${fns:getDictLabel(cookie.theme.value,'theme','默认主题')}<b class="caret"></b></a>
  188. <ul class="dropdown-menu">
  189. <c:forEach items="${fns:getDictList('theme')}" var="dict">
  190. <li><a href="#"
  191. onclick="location='${pageContext.request.contextPath}/theme/${dict.value}?url='+location.href">${dict.label}</a>
  192. </li>
  193. </c:forEach>
  194. </ul>
  195. <!--[if lte IE 6]>
  196. <script type="text/javascript">$('#themeSwitch').hide();</script><![endif]-->
  197. </div>
  198. </form>
  199. <div class="footer">
  200. Copyright &copy; 2014 - <span id="copyrightYear"></span> ${fns:getConfig('productName')} ${fns:getConfig('version')}
  201. </div>
  202. <script src="${ctxStatic}/flash/zoom.min.js" type="text/javascript"></script>
  203. <script src="${ctxStatic}/slideVerify/slideVerify.js" type="text/javascript"></script>
  204. <script>
  205. $(function () {
  206. let date = new Date()
  207. $('#copyrightYear').text( date.getFullYear())
  208. })
  209. </script>
  210. </body>
  211. </html>