login.ejs 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  6. <meta http-equiv="x-ua-compatible" content="ie=edge">
  7. <title>用户登录-计量支付</title>
  8. <link rel="stylesheet" href="/public/css/bootstrap/bootstrap.min.css">
  9. <link rel="stylesheet" href="/public/css/main.css">
  10. <link rel="stylesheet" href="/public/css/toast.css">
  11. <link rel="stylesheet" href="/public/css/font-awesome/font-awesome.min.css">
  12. <link rel="stylesheet" type="text/css" href="/public/css/jquery-ui/jquery-ui.min.css">
  13. <link rel="shortcut icon" href="/public/images/favicon.ico">
  14. <style>
  15. html{height:100%;}
  16. </style>
  17. </head>
  18. <body class="login-new-body img-<%- Math.floor(Math.random()*9 + 1); %>">
  19. <div class="login-new-b d-flex flex-row align-items-center mt-4 ml-5">
  20. <div>
  21. <img src="/public/images/image_nav_logo.png">
  22. </div>
  23. <div class="ml-3">
  24. <div class="logo-big-title text-white mt-1">纵横云计量</div>
  25. <div class="logo-sm-title mt-1">计量支付&nbsp;&nbsp;&nbsp;结算决算</div>
  26. </div>
  27. <div class="side-border ml-4 mr-4"></div>
  28. <div class="top-subtitle">管好项目每一分钱</div>
  29. <h5 class="ml-auto logo-big-title text-danger mr-3 login-tip"><% if (projectData && ['Y3T2Q','P0505'].indexOf(projectData.code.toUpperCase()) !== -1) { %>当前处于办公网络非涉密网络,严禁传输处理涉密信息!<% } %></h5>
  30. </div>
  31. <div class="container">
  32. <div class="d-flex justify-content-center align-items-center content-center">
  33. <div class="left-login text-white pt-5 px-5">
  34. <h2>Hi,您好!</h2>
  35. <div class="login-border my-4"></div>
  36. <div class="left-login-title" id="project_name"><% if (projectData) { %><%- projectData.name %><% } else { %>管好项目每一分钱<% } %></div>
  37. </div>
  38. <% if (maintainData.status === maintainConst.status.ongoing) { %>
  39. <form class="right-login position-relative text-center">
  40. <h3 class="mt-5 mb-5"><i class="fa fa-wrench"></i>系统正在维护</h3>
  41. <div>&nbsp;</div>
  42. <h5 class="mt-5 mb-5">预计恢复时间<%- (maintainData.duration !== maintainConst.duration.forever ? '为 ' + ctx.helper.dateTran(parseFloat(maintainData.maintain_time) + ctx.helper.timeAdd(maintainData.duration)) : ' 暂未确定') %></h5>
  43. <h5>造成不便敬请谅解。</h5>
  44. </form>
  45. <% } else { %>
  46. <form method="post" action="/login" id="normal-form" class="right-login position-relative text-center" style="min-width: 360px;">
  47. <h3 class="mt-5 <% if (projectData) { %>mb-5<% } else { %>mb-4<% } %>">欢迎登录</h3>
  48. <div class="position-absolute"><a href="javascript:void(0);" class="change-form" data-toggle="tooltip" data-placement="left" title="微信登录"><img alt="微信扫码登录" src="/public/images/icon_login_qr.png"></a></div>
  49. <div class="mx-4">
  50. <div <% if (projectData) { %>style="display: none"<% } %> class="input-group mb-4 <% if (errorMessage !== undefined && errorMessage !== null) { %>has-danger<% } %>">
  51. <div class="input-group-prepend">
  52. <div class="input-group-text"><img src="/public/images/icon_login_folder.png"></div>
  53. </div>
  54. <input type="text" id="project" class="form-control" name="project" value="<% if (projectData) { %><%- projectData.code %><% } %>" placeholder="项目编号" autofocus="">
  55. </div>
  56. <div class="input-group mb-4 <% if (errorMessage !== undefined && errorMessage !== null) { %>has-danger<% } %>">
  57. <div class="input-group-prepend">
  58. <div class="input-group-text"><img src="/public/images/icon_login_user.png"></div>
  59. </div>
  60. <input type="text" id="account" class="form-control" name="account" placeholder="账号" autofocus="">
  61. </div>
  62. <div class="input-group mb-2 <% if (errorMessage !== undefined && errorMessage !== null) { %>has-danger<% } %>">
  63. <div class="input-group-prepend">
  64. <div class="input-group-text"><img src="/public/images/icon_login_lock.png"></div>
  65. </div>
  66. <input type="password" id="project-password" name="project_password" class="form-control" placeholder="密码">
  67. <div class="input-group-append">
  68. <div class="input-group-text" style="cursor: pointer; background-color: #fff; border-left: none;" id="toggle-password">
  69. <i class="fa fa-eye-slash" id="password-icon"></i>
  70. </div>
  71. </div>
  72. </div>
  73. <div class="form-group <% if (projectData) { %>mb-5<% } else { %>mb-4<% } %>">
  74. <div class="form-check d-flex justify-content-start pl-0">
  75. <label class="form-check-label" for="exampleCheck1"><a href="#fg-password" data-toggle="modal" data-target="#fg-password">忘记密码?</a></label>
  76. <% if (projectData) { %><label class="form-check-label ml-auto" for="exampleCheck1"><a href="/">切换系统</a></label><% } %>
  77. </div>
  78. </div>
  79. <button type="submit" class="btn btn-primary btn-block">登&nbsp;&nbsp;录</button>
  80. <div class="alert alert-danger mt-1 py-2 inputErrow" <% if(errorMessage === undefined || errorMessage === null) { %>style="display: none"<% } %> role="alert" id="error-msg">
  81. <% if(errorMessage !== undefined && errorMessage !== null) { %><b>登录失败</b> <%= errorMessage %><% } %>
  82. </div>
  83. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>" />
  84. <input type="hidden" name="type" value="2" />
  85. <input type="hidden" name="hide_code" value="<% if (projectData) { %>1<% } else { %>0<% } %>" />
  86. </div>
  87. </form>
  88. <form id="code-form" class="right-login position-relative text-center" style="min-width: 360px;display: none">
  89. <h5>&nbsp;</h5>
  90. <div class="position-absolute"><a href="javascript:void(0);" class="change-form" data-toggle="tooltip" data-placement="left" title="账号登录"><img alt="账号登录" src="/public/images/icon_login_pc.png"></a></div>
  91. <div id="wx-code" style="text-align: center">
  92. </div>
  93. </form>
  94. <% } %>
  95. </div>
  96. <div class="text-white fixed-bottom"><p class="text-center mb-1">Copyright © 2019 <a href="https://smartcost.com.cn" target="_blank" class="text-white">珠海纵横创新软件有限公司</a>.All Rights Reserved.<a class="text-white ml-2" href="https://beian.miit.gov.cn" target="_blank">粤ICP备14032472号</a></p></div>
  97. </div>
  98. <!--忘记项目版密码-->
  99. <div class="modal fade" id="fg-password" data-backdrop="static">
  100. <div class="modal-dialog" role="document">
  101. <div class="modal-content">
  102. <div class="modal-header">
  103. <h5 class="modal-title">找回密码</h5>
  104. </div>
  105. <div class="modal-body">
  106. <div class="form-group">
  107. <label>项目编号</label>
  108. <input class="form-control" id="forget-project" placeholder="输入项目编号" <% if (projectData) { %>readonly<% } %>>
  109. <div class="invalid-feedback"></div>
  110. </div>
  111. <div class="form-group">
  112. <label>登录账号</label>
  113. <input class="form-control" id="forget-name" placeholder="输入登录账号">
  114. <div class="invalid-feedback"></div>
  115. </div>
  116. </div>
  117. <div class="modal-footer">
  118. <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
  119. <button type="button" class="btn btn-primary" id="forget-btn">重置密码</button>
  120. </div>
  121. </div>
  122. </div>
  123. </div>
  124. <!--忘记项目版密码-->
  125. <div class="modal fade" id="fg-password-done" data-backdrop="static">
  126. <div class="modal-dialog" role="document">
  127. <div class="modal-content">
  128. <div class="modal-header">
  129. <h5 class="modal-title">密码发送成功</h5>
  130. </div>
  131. <div class="modal-body">
  132. <h5>尊敬的 <b></b>,您的账号 <b></b>,新密码已经发送至 <b></b>,注意查收。</h5>
  133. </div>
  134. <div class="modal-footer">
  135. <button type="button" class="btn btn-secondary" data-dismiss="modal" id="focus-pwd">关闭</button>
  136. </div>
  137. </div>
  138. </div>
  139. </div>
  140. <!-- JS. -->
  141. <div class="toast" style="text-align: center">
  142. <i class="icon fa"></i>
  143. <span class="message"></span>
  144. </div>
  145. <!-- JS. -->
  146. <script src="/public/js/jquery/jquery-3.2.1.min.js"></script>
  147. <script src="/public/js/popper/popper.min.js"></script>
  148. <script src="/public/js/bootstrap/bootstrap.min.js"></script>
  149. <script src="/public/js/jquery/jquery-ui.js"></script>
  150. <script src="/public/js/global.js"></script>
  151. <script>
  152. const csrf = '<%= ctx.csrf %>';
  153. </script>
  154. <% if (projectData) { %>
  155. <script>
  156. $(document).ready(function() {
  157. setLocalCache('project_name', '<%- projectData.name %>');
  158. setLocalCache('project_code', '<%- projectData.code %>');
  159. });
  160. </script>
  161. <% } %>
  162. <script src="/public/js/login.js"></script>
  163. <script src="https://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js"></script>
  164. <script>
  165. $(function () {
  166. const obj = new WxLogin({
  167. self_redirect:false,
  168. id:"wx-code",
  169. appid: "<%- appid %>",
  170. scope: "snsapi_login",
  171. redirect_uri: "<%- hostUrl %>/wxAuth",
  172. state: getQueryString('referer'),
  173. style: "black",
  174. href: ""
  175. });
  176. function getQueryString(name) {
  177. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
  178. var r = window.location.search.substr(1).match(reg); //获取url中"?"符后的字符串并正则匹配
  179. var context = "";
  180. if (r != null)
  181. context = r[2];
  182. reg = null;
  183. r = null;
  184. return context == null || context == "" || context == "undefined" ? "" : context;
  185. }
  186. $('.change-form').on('click', function () {
  187. $(this).parents('form').hide();
  188. $(this).parents('form').siblings('form').show();
  189. })
  190. })
  191. </script>
  192. </body>
  193. </html>