login.ejs 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  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. <% if (projectData && ['Y3T2Q','P0505'].indexOf(projectData.code) !== -1) { %><h5 class="ml-auto logo-big-title text-danger mr-3">当前处于办公网络非涉密网络,严禁传输处理涉密信息!</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>
  68. <div class="form-group <% if (projectData) { %>mb-5<% } else { %>mb-4<% } %>">
  69. <div class="form-check d-flex justify-content-start pl-0">
  70. <label class="form-check-label" for="exampleCheck1"><a href="#fg-password" data-toggle="modal" data-target="#fg-password">忘记密码?</a></label>
  71. <% if (projectData) { %><label class="form-check-label ml-auto" for="exampleCheck1"><a href="/">切换系统</a></label><% } %>
  72. </div>
  73. </div>
  74. <button type="submit" class="btn btn-primary btn-block">登&nbsp;&nbsp;录</button>
  75. <div class="alert alert-danger mt-1 py-2 inputErrow" <% if(errorMessage === undefined || errorMessage === null) { %>style="display: none"<% } %> role="alert" id="error-msg">
  76. <% if(errorMessage !== undefined && errorMessage !== null) { %><b>登录失败</b> <%= errorMessage %><% } %>
  77. </div>
  78. <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>" />
  79. <input type="hidden" name="type" value="2" />
  80. <input type="hidden" name="hide_code" value="<% if (projectData) { %>1<% } else { %>0<% } %>" />
  81. </div>
  82. </form>
  83. <form id="code-form" class="right-login position-relative text-center" style="min-width: 360px;display: none">
  84. <h5>&nbsp;</h5>
  85. <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>
  86. <div id="wx-code" style="text-align: center">
  87. </div>
  88. </form>
  89. <% } %>
  90. </div>
  91. <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>
  92. </div>
  93. <!--忘记项目版密码-->
  94. <div class="modal fade" id="fg-password" data-backdrop="static">
  95. <div class="modal-dialog" role="document">
  96. <div class="modal-content">
  97. <div class="modal-header">
  98. <h5 class="modal-title">找回密码</h5>
  99. </div>
  100. <div class="modal-body">
  101. <div class="form-group">
  102. <label>项目编号</label>
  103. <input class="form-control" id="forget-project" placeholder="输入项目编号" <% if (projectData) { %>readonly<% } %>>
  104. <div class="invalid-feedback"></div>
  105. </div>
  106. <div class="form-group">
  107. <label>登录账号</label>
  108. <input class="form-control" id="forget-name" placeholder="输入登录账号">
  109. <div class="invalid-feedback"></div>
  110. </div>
  111. </div>
  112. <div class="modal-footer">
  113. <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
  114. <button type="button" class="btn btn-primary" id="forget-btn">重置密码</button>
  115. </div>
  116. </div>
  117. </div>
  118. </div>
  119. <!--忘记项目版密码-->
  120. <div class="modal fade" id="fg-password-done" data-backdrop="static">
  121. <div class="modal-dialog" role="document">
  122. <div class="modal-content">
  123. <div class="modal-header">
  124. <h5 class="modal-title">密码发送成功</h5>
  125. </div>
  126. <div class="modal-body">
  127. <h5>尊敬的 <b></b>,您的账号 <b></b>,新密码已经发送至 <b></b>,注意查收。</h5>
  128. </div>
  129. <div class="modal-footer">
  130. <button type="button" class="btn btn-secondary" data-dismiss="modal" id="focus-pwd">关闭</button>
  131. </div>
  132. </div>
  133. </div>
  134. </div>
  135. <!-- JS. -->
  136. <div class="toast" style="text-align: center">
  137. <i class="icon fa"></i>
  138. <span class="message"></span>
  139. </div>
  140. <!-- JS. -->
  141. <script src="/public/js/jquery/jquery-3.2.1.min.js"></script>
  142. <script src="/public/js/popper/popper.min.js"></script>
  143. <script src="/public/js/bootstrap/bootstrap.min.js"></script>
  144. <script src="/public/js/jquery/jquery-ui.js"></script>
  145. <script src="/public/js/global.js"></script>
  146. <script>
  147. const csrf = '<%= ctx.csrf %>';
  148. </script>
  149. <% if (projectData) { %>
  150. <script>
  151. $(document).ready(function() {
  152. setLocalCache('project_name', '<%- projectData.name %>');
  153. setLocalCache('project_code', '<%- projectData.code %>');
  154. });
  155. </script>
  156. <% } %>
  157. <script src="/public/js/login.js"></script>
  158. <script src="https://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js"></script>
  159. <script>
  160. $(function () {
  161. const obj = new WxLogin({
  162. self_redirect:false,
  163. id:"wx-code",
  164. appid: "<%- appid %>",
  165. scope: "snsapi_login",
  166. redirect_uri: "<%- hostUrl %>/wxAuth",
  167. state: getQueryString('referer'),
  168. style: "black",
  169. href: ""
  170. });
  171. function getQueryString(name) {
  172. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
  173. var r = window.location.search.substr(1).match(reg); //获取url中"?"符后的字符串并正则匹配
  174. var context = "";
  175. if (r != null)
  176. context = r[2];
  177. reg = null;
  178. r = null;
  179. return context == null || context == "" || context == "undefined" ? "" : context;
  180. }
  181. $('.change-form').on('click', function () {
  182. $(this).parents('form').hide();
  183. $(this).parents('form').siblings('form').show();
  184. })
  185. })
  186. </script>
  187. </body>
  188. </html>