| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
- <meta http-equiv="x-ua-compatible" content="ie=edge">
- <title>用户登录-计量支付</title>
- <link rel="stylesheet" href="public/css/bootstrap/bootstrap.min.css">
- <link rel="stylesheet" href="public/css/main.css">
- <link rel="stylesheet" href="/public/css/toast.css">
- <link rel="stylesheet" href="public/css/font-awesome/font-awesome.min.css">
- </head>
- <body class="login-body">
- <div class="container">
- <!--演示版-->
- <form class="form-signin" method="post" action="/login">
- <h4 class="d-flex justify-content-center mb-4"><span id="project_name"></span>纵横云计量</h4>
- <p class="text-center mb-4 text-muted"></p>
- <!--<nav class="nav nav-tabs nav-justified mb-3" role="tablist" id="login-tab">-->
- <!--<a class="nav-item nav-link" data-toggle="tab" data-type="1" href="#preview" role="tab">演示版登录</a>-->
- <!--<a class="nav-item nav-link active" data-toggle="tab" data-type="2" href="#paid" role="tab">项目版登录</a>-->
- <!--</nav>-->
- <div class="tab-content">
- <!--<div class="tab-pane active" id="preview" role="tabpanel">-->
- <!--<div class="form-group <% if (errorMessage !== undefined && errorMessage !== null) { %>has-danger<% } %>">-->
- <!--<input id="username" name="username" class="form-control form-control-sm" placeholder="通行账号 邮箱/手机" value="laiku123@qq.com" autofocus="">-->
- <!--</div>-->
- <!--<div class="form-group <% if (errorMessage !== undefined && errorMessage !== null) { %>has-danger<% } %>">-->
- <!--<input id="password" name="password" class="form-control form-control-sm" placeholder="输入密码" value="19930523" type="password">-->
- <!--</div>-->
- <!--</div>-->
- <div class="tab-pane active" id="paid" role="tabpanel">
- <div class="form-group <% if (errorMessage !== undefined && errorMessage !== null) { %>has-danger<% } %>">
- <input id="project" class="form-control" name="project" placeholder="项目编号" autofocus="" />
- </div>
- <div class="form-group <% if (errorMessage !== undefined && errorMessage !== null) { %>has-danger<% } %>">
- <input id="account" class="form-control" name="account" placeholder="输入账号" autofocus="" />
- </div>
- <div class="form-group <% if (errorMessage !== undefined && errorMessage !== null) { %>has-danger<% } %>">
- <input id="project-password" name="project_password" class="form-control" placeholder="输入密码" type="password" />
- </div>
- </div>
- <div class="form-group">
- <div class="alert alert-danger" <% if(errorMessage === undefined || errorMessage === null) { %>style="display: none"<% } %> role="alert" id="error-msg">
- <% if(errorMessage !== undefined && errorMessage !== null) { %><strong>登录失败</strong> <%= errorMessage %><% } %>
- </div>
- </div>
- </div>
- <div class="form-group">
- <button class="btn btn-primary btn-block" type="submit">登录</button>
- <input type="hidden" name="_csrf" value="<%= ctx.csrf %>" />
- <input type="hidden" name="type" value="2" />
- </div>
- <!--<div class="pt-1 d-flex justify-content-center">-->
- <!--<a href="http://sso.smartcost.com.cn/getpasswd" target="_blank" class="mr-3">忘记密码</a>-->
- <!--<a href="http://sso.smartcost.com.cn/reg" target="_blank">免费注册</a>-->
- <!--</div>-->
- </form>
- <!--项目版-->
- <div class="text-white fixed-bottom"><p class="text-center mb-1">Copyright © 2018 <a href="https://smartcost.com.cn" target="_blank" class="text-white">珠海纵横创新软件有限公司</a>.All Rights Reserved.<a class="text-white ml-2" href="http://www.miitbeian.gov.cn" target="_blank">粤ICP备14032472号</a></p></div>
- </div>
- <div class="toast" style="text-align: center">
- <i class="icon fa"></i>
- <span class="message"></span>
- </div>
- <!-- JS. -->
- <script src="/public/js/jquery/jquery-3.2.1.min.js"></script>
- <script src="/public/js/popper/popper.min.js"></script>
- <script src="/public/js/bootstrap/bootstrap.min.js"></script>
- <script src="/public/js/global.js"></script>
- <script type="text/javascript">
- $(document).ready(function() {
- const lSPName = getLocalCache('project_name');
- const lSPCode = getLocalCache('project_code');
- if (lSPName !== null) {
- $('#project_name').text(lSPName);
- $('#project').val(lSPCode);
- $('#account').focus();
- }
- $("#login-tab a[data-toggle='tab']").on('shown.bs.tab', function () {
- let type = $(this).data('type');
- type = parseInt(type);
- type = isNaN(type) || type <= 0 ? 1 : type;
- $("input[name='type']:hidden").val(type);
- });
- // $('#username').blur(function () {
- // let account = $(this).val();
- // // 判断输入的邮箱/手机是否格式正确
- // if(/^1[3456789]\d{9}$/.test(account) || /^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/.test(account)) {
- // $('#error-msg').hide();
- // } else {
- // $('#error-msg').show();
- // $('#error-msg').text('账号格式有误');
- // }
- // })
- $('#project').blur(function () {
- if ($(this).val() == '') {
- $('#project_name').text('');
- removeLocalCache('project_code');
- removeLocalCache('project_name');
- } else {
- const pcode = getLocalCache('project_code');
- if ($(this).val() !== pcode) {
- const pc = $(this).val();
- $.ajax({
- type: 'get',
- url: '/project/name',
- data: { code: pc },
- dataType: 'json',
- success: function (result) {
- setLocalCache('project_code', pc);
- if (result.err === 1) {
- $('#project_name').text('');
- console.log(result.msg);
- toast(result.msg, 'error', 'exclamation-circle');
- removeLocalCache('project_name');
- } else {
- setLocalCache('project_name', result.data);
- $('#project_name').text(result.data);
- }
- }
- })
- }
- }
- })
- });
- </script>
- </body>
- </html>
|