index.htm 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>${context.getContextName()}</title>
  5. <meta charset="UTF-8">
  6. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  7. ${Styles.src(zhiqim.css)}
  8. ${Scripts.src(zhiqim.js)}
  9. ${Scripts.src(jsencrypt.js)}
  10. ${Styles.htmlOverflowHidden()}
  11. <style>
  12. body{color:#333;background-color:#747f9d;background-image: url(ztmpl/zhiqim_manager/index_bg_00.jpg);background-repeat: no-repeat;background-size:100%;}
  13. body,table,td,div{font-size:14px;line-height:120%;}
  14. a,a:visited{color:#333;text-decoration:none;cursor:pointer;}
  15. a:active,a:hover{color:#1e7eec;text-decoration:none;}
  16. .header{position:fixed;width:100%;height:40px;line-height:40px;background-color:#000; background:rgba(0,0,0,0.2); filter:alpha(opacity=20);}
  17. .footer{position:fixed;bottom:0px; width:100%;height:40px;background:rgba(255,255,255,0.2);line-height:40px;text-align:center;color:#fff;}
  18. .login{background-image: url(ztmpl/zhiqim_manager/00_default/index_bg_center.jpg);background-repeat:repeat-y; width:825px;}
  19. .input{background-color:#3f3f40;color:#fffafa;font-size:20px;letter-spacing:1px;border:2px solid #5c5c5c;border-radius:5px;height:45px;line-height:45px;text-indent:10px;font-family:Consolas,"微软雅黑";}
  20. .input:focus{border-color:#708090;}
  21. .input.verificationCode{letter-spacing:4px;}
  22. </style>
  23. <script>
  24. Z.onload(function()
  25. {//默认焦点
  26. if (Z.V.isEmpty(Z("#operatorCode").val()))
  27. Z("#operatorCode").focus();
  28. else if (Z.V.isEmpty(Z("#operatorPass").val()))
  29. Z("#operatorPass").focus();
  30. else if (Z("#verificationCode").length > 0)
  31. Z("#verificationCode").focus();
  32. Z(document).keydown(function(e)
  33. {
  34. if (Z.E.key(e) != Z.E.KEY.ENTER)
  35. return;
  36. if (!Z.Dialog.cache.isEmpty())
  37. return;
  38. doLogin();
  39. });
  40. });
  41. function doRememberCode(rememberCode)
  42. {//取消记住账号时,同时取消记住密码
  43. if (!rememberCode.checked)
  44. {
  45. Z("#rememberPass")[0].checked = false;
  46. Z("[data-id=rememberPass]").removeClass("z-active");
  47. }
  48. }
  49. function doRememberPass(rememberPass)
  50. {//记住密码时,同时记住账号
  51. if (rememberPass.checked)
  52. {
  53. Z("#rememberCode")[0].checked = true;
  54. Z("[data-id=rememberCode]").addClass("z-active");
  55. }
  56. }
  57. function doLogin()
  58. {//登陆
  59. var operatorCode = Z("#operatorCode").val();
  60. if (Z.V.isEmptyBlank(operatorCode))
  61. {//用户名和密码必填
  62. Z.failure("用户名不能为空!",function(){
  63. Z("#operatorCode").focus();
  64. });
  65. return;
  66. }
  67. var operatorPass = Z("#operatorPass").val();
  68. if (Z.V.isEmptyBlank(operatorPass))
  69. {//用户名和密码必填
  70. Z.failure("密码不能为空!",function(){
  71. Z("#operatorPass").focus();
  72. });
  73. return;
  74. }
  75. var verificationCode = Z("#verificationCode").val();
  76. if (Z("#verificationCode").length > 0 && verificationCode.length != 4)
  77. {//如果有验证码框的时候,要求值必须是4位(数字在输入时控制)
  78. Z.failure("验证码为4位数字!");
  79. return;
  80. }
  81. //对密码进行RSA加密
  82. var publicKey = "${ZmrParamDao.getPublicKey(context)}";
  83. var encrypt = new JSEncrypt();
  84. encrypt.setPublicKey(publicKey);
  85. operatorPass = encrypt.encrypt(operatorPass);
  86. var ajax = new Z.Ajax();
  87. ajax.setContextPath("${context.getContextPath()}");
  88. ajax.setClassName("ZmrLoginPresenter");
  89. ajax.setMethodName("doLogin");
  90. ajax.addParam("operatorCode", operatorCode);
  91. ajax.addParam("operatorPass", operatorPass);
  92. ajax.addParam("role", "oms");
  93. ajax.addParam("verificationCode", verificationCode);
  94. <#if hasRememberCode>
  95. ajax.addParam("rememberCode", Z("#rememberCode")[0].checked);
  96. </#if>
  97. <#if hasRememberPass>
  98. ajax.addParam("rememberPass", Z("#rememberPass")[0].checked);
  99. </#if>
  100. ajax.setFailureAlertRecovery();
  101. ajax.setSuccessLocationResponse();
  102. ajax.setLoading("login", "正在登录...", {disabled:true,recovery:false});
  103. ajax.execute();
  104. }
  105. </script>
  106. </head>
  107. <body>
  108. ${Htmls.toCallFrame()}
  109. <div class="header">
  110. <div class="z-float-left z-w400 z-lh40 z-pd-l10 z-color-white">欢迎登录&nbsp;&nbsp;[&nbsp;${context.getContextName()}&nbsp;]!</div>
  111. <div class="z-float-right z-text-right z-w200 z-lh40 z-pd-r10"></div>
  112. </div>
  113. <div class="z-absolute-center-middle login" style="height:<#if hasVerificationCode && hasRememberCode>410<#elseif hasVerificationCode>360<#elseif hasRememberCode>350<#else>300</#if>px">
  114. <table class="z-table z-h100p">
  115. <tr>
  116. <td width="50%" class="z-text-center"><img src="ztmpl/zhiqim_manager/index_logo_00.png"></td>
  117. <td width="50%" valign="top" rowspan="2">
  118. <input type="text" class="z-hidden-fixed"/>
  119. <input type="password" class="z-hidden-fixed"/>
  120. <table class="z-table z-mg-l30 z-h70-tr z-pd5 z-color-white">
  121. <tr>
  122. <td class="z-px20 z-text-gray z-mg-t10">用户登录</td>
  123. </tr>
  124. <tr>
  125. <td><input id="operatorCode" class="z-w300 input" placeholder="用户名" value="#{operatorCode}" maxlength="16" spellcheck="false" autocomplete="off"></td>
  126. </tr>
  127. <tr>
  128. <td><input id="operatorPass" type="password" class="z-w300 input" placeholder="密码" value="#{operatorPass}" maxlength="16" spellcheck="false" autocomplete="off"></td>
  129. </tr>
  130. <#if hasVerificationCode>
  131. <tr>
  132. <td>
  133. <input id="verificationCode" class="z-w200 input verificationCode" placeholder="验证码" data-options="type:Numeric;paste:true;" maxlength="4" spellcheck="false" autocomplete="off">
  134. <img class="z-pointer z-bd-rd5 z-mg-t-8" title="点击刷新验证码" onclick="this.src='service/vcode.jpg?bgColor=%231299ec&width=95&height=42&fontSize=20&yawp=true&t='+new Date().getTime();" src="service/vcode.jpg?bgColor=%231299ec&width=95&height=42&fontSize=20&yawp=true&t=${DateTimes.getDateTime17String()}">
  135. </td>
  136. </tr>
  137. </#if>
  138. <#if hasRememberCode>
  139. <tr class="zi-h40">
  140. <td class="z-px16 z-text-gray">
  141. <input id="rememberCode" type="checkbox" data-role="z-checkbox" data-class="z-mg-r10 ${zmr_color_class}" onclick="doRememberCode(this);" <#if Validates.isNotEmpty(operatorCode)>checked</#if>>记住用户名
  142. <#if hasRememberPass>
  143. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  144. <input id="rememberPass" type="checkbox" data-role="z-checkbox" data-class="z-mg-r10 ${zmr_color_class}" onclick="doRememberPass(this);" <#if Validates.isNotEmpty(operatorPass)>checked</#if>/>记住密码
  145. </#if>
  146. </td>
  147. </tr>
  148. </#if>
  149. <tr>
  150. <td><button id="login" class="z-button z-w300 z-h50 zi-px20 ${zmr_color_class}" onclick="doLogin()">登&nbsp;&nbsp;录</button></td>
  151. </tr>
  152. </table>
  153. </td>
  154. </tr>
  155. <tr class="z-h120">
  156. <td class="z-text-center" valign="top"><img src="ztmpl/zhiqim_manager/index_slogan_00.png"/></td>
  157. </tr>
  158. </table>
  159. </div>
  160. <div class="footer">Copyright © 2023 领淘众创 All Rights Reserved <a href="https://beian.miit.gov.cn/" style="color: white" target="_blank">备案号:闽ICP备2023014112号-1 </a></div>
  161. </body>
  162. </html>