管道基础大数据平台系统开发-【CS】-ExportMap
1
13693261870
2023-02-03 a3d3b0ea3f49a482b8938ee5ad450d917ad509ec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<!DOCTYPE>
<html>
<head>
  <title>Óû§µÇ¼</title>
  <meta charset="GBK" />
  <meta http-equiv="pragma" content="no-cache" />
  <meta http-equiv="cache-control" content="no-cache" />
  <meta http-equiv="expires" content="0" />
  <meta name="renderer" content="webkit|ie-comp|ie-stand" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8" />
  <script src="js/jquery.min.js"></script>
  <script src="js/rsa.min.js"></script>
</head>
<body style="height: 100%; width: 100%; padding: 0; margin: 0; overflow: hidden;">
  <div style="padding: 20px; box-sizing: border-box;">
    <section>
      <p style="font-size: 18px; font-weight: bold;">µ¥µãµÇ¼</p>
    </section>
    <!-- Óû§Ãû -->
    <section>
      <label for="username">Óû§Ãû£º</label>
      <input class="required" id="username" placeholder="ÇëÊäÈëÓû§Ãû" size="20" tabindex="1"
        type="text" accesskey="n" autocomplete="off" name="username" value="admin" />
    </section>
    <!-- ÃÜÂë -->
    <section>
      <div class="loginpwd" style='width: 400px; margin-right: 20px; margin-top: 30px; border-bottom: 1px solid #fff;'>
        <span style="visibility: hidden;">Çë</span><label for="password">ÃÜÂ룺</label>
        <input class="required" placeholder="ÇëÊäÈëÃÜÂë" type="password" id="password" size="20" tabindex="2"
          accesskey="p" autocomplete="off" name="password" value="Admin@1234_lf" /><span id="capslock-on" style="display: none;">
            <i class="fa fa-exclamation-circle"></i>
            <span>CAPSLOCK key is turned on!</span>
          </span>
      </div>
    </section>
    <!-- µÇ¼°´Å¥ -->
    <section>
      <span style="visibility: hidden;">ÇëÊäÈ룺</span>
      <input style="margin-top: 25px; cursor: pointer;" name="submit" accesskey="l" value="µÇ Â¼" tabindex="3" type="button" onclick="sysLogin();">
    </section>
  </div>
  <script>
    var url = "http://127.0.0.1:12316/server/";
 
    var isBusy = false;
 
    window.onload = function () {
      getPublicKey();
    }
 
    function getPublicKey() {
      $.get(url + "sign/getPublicKey", function (rs) {
        if (rs && rs.code == 200) {
          window.encrypt = new JSEncrypt();
          encrypt.setPublicKey(rs.result);
        }
      });
    }
 
    function sysValidate() {
      // ÑéÖ¤Óû§ÃûÓëÃÜÂë
      var theUsername = document.getElementById("username").value;
      if (theUsername.length <= 0) {
        $("#eMsg").html("Ìáʾ£ºÇëÊäÈëÓû§Ãû£¡");
        $("#username").focus();
        return false;
      }
      var thePassword = document.getElementById("password").value;
      if (thePassword.length <= 0) {
        $("#eMsg").html("Ìáʾ£ºÇëÊäÈëÃÜÂ룡");
        $("#password").focus();
        return false;
      }
 
      return true;
    }
 
    function sysLogin() {
      if (isBusy || !sysValidate()) {
        return;
      }
 
      isBusy = true;
      var username = $.trim($("#username").val());
      var password = $("#password").val();
 
      var data = {
        "uid": encrypt.encrypt(username),
        "pwd": encrypt.encrypt(password)
      };
 
      $.ajax({
        url: url + "sign/login",
        type: "POST",
        data: JSON.stringify(data),
        dataType: "json", // html¡¢json¡¢jsonp¡¢script¡¢text
        contentType: "application/json", // "application/json", "application/x-www-form-urlencoded",
        success: function (rs) {
          isBusy = false;
 
          if (!rs || rs.code != 200) {
            var msg = rs && rs.msg ? rs.msg : "µÇ¼ʧ°Ü£¡";
            $("#eMsg").html(msg);
            return;
          }
 
          alert("µÇ¼³É¹¦£¡");
          setLoginInfo(rs.result);
        },
        error: function (e) {
          isBusy = false;
          console.error(e);
          alert("µÇ¼³ö´í£¬ÇëÁªÏµ¹ÜÀíÔ±£¡");
        }
      });
    }
 
    function ajax(url, type, data, dataType, contentType, fn, efn) {
      $.ajax({
        url: url,
        type: type,
        data: data,
        dataType: dataType || "json", // html¡¢json¡¢jsonp¡¢script¡¢text
        contentType: contentType || "application/json", // "application/x-www-form-urlencoded"
        success: function (data) {
          fn(data);
        },
        error: function (e) {
          console.error(e);
          fn();
        }
      });
    }
 
    document.onkeydown = function (e) {
      var ev = window.event || e;
      var code = ev.keyCode || ev.which || ev.charCode;
      if (code == 13) {
        sysLogin();
      }
    }
 
    function setLoginInfo(rs) {
      try {
        ntst.setLogin(rs.createUser, rs.uname, rs.token);
      } catch (e) {
        //
      }
    }
 
    function isValid(pwd) {
      if (pwd) {
        var regex = new RegExp('^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\W!@#$%^&*`~()\\-_+=,.?;<>]+$)(?![a-z0-9]+$)(?![a-z\W!@#$%^&*`~()\\-_+=,.?;<>]+$)(?![0-9\W!@#$%^&*`~()\\-_+=,.?;<>]+$)[a-zA-Z0-9\W!@#$%^&*`~()\\-_+=,.?;<>]{12,20}$');
        return regex.test(pwd)
      }
      return false;
    }
  </script>
</body>
</html>