管道基础大数据平台系统开发-【CS】-ExportMap
1
13693261870
2022-12-27 bb6f4ff31995d3e0acd8b18a288dedc31b0aa51b
1
已添加1个文件
已修改2个文件
315 ■■■■■ 文件已修改
ExportMap/ExportMap.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ExportMap/api.html 310 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ExportMap/up.html 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ExportMap/ExportMap.csproj
@@ -102,6 +102,7 @@
    </Reference>
  </ItemGroup>
  <ItemGroup>
    <Content Include="api.html" />
    <Content Include="DLL\log4net4.dll" />
    <Content Include="DLL\Mono.Security.dll" />
    <Content Include="DLL\Npgsql.dll" />
ExportMap/api.html
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,310 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>API接口</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <script src="js/jquery.1.12.4.js"></script>
  <script src="js/rsa.min.js"></script>
  <script src="js/rollups.js"></script>
  <script>
    var app = {};
    var path = "20221128010101";
    var url = "http://127.0.0.1:12316/server/";
    var token = "b6d650b7-8eff-41f6-9fc7-8ec1c73cd567";
    $(function () {
      $("#pathSpan").html(path);
      $("#tokenSpan").html(token);
      getPublicKey();
    });
    // Ajax
    function ajax(url, type, data, dataType, contentType, fn) {
      $.ajax({
        url: url,
        type: type,
        data: data,
        dataType: dataType || "json",
        contentType: contentType || "application/json",
        success: function (data) {
          fn(data);
        },
        error: function (e) {
          console.error(e);
          fn();
        }
      });
    }
    // èŽ·å–URL
    function getUrl(method) {
      return url + method + "?token=" + token;
    }
  </script>
  <script>
    // èŽ·å–å…¬é’¥
    function getPublicKey() {
      $.get("http://127.0.0.1:12316/server/sign/getPublicKey", function (rs) {
        if (rs && rs.code == 200) {
          window.encrypt = new JSEncrypt();
          encrypt.setPublicKey(rs.result);
        }
      });
    }
    // ç™»å½•
    function login() {
      var data = {
        "uid": encrypt.encrypt("admin"), // ç”¨æˆ·åï¼ŒRSA加密
        "pwd": encrypt.encrypt("Admin@1234_lf") // å¯†ç ï¼ŒRSA加密
      };
      $.ajax({
        url: "http://127.0.0.1:12316/server/sign/login",
        type: "POST",
        data: JSON.stringify(data),
        dataType: "json",
        contentType: "application/json",
        success: function (rs) {
          if (!rs || rs.code != 200) {
            $("登录失败!\n" + rs.msg);
            return;
          }
          console.log(rs);
        },
        error: function (e) {
          console.error(e);
        }
      });
    }
    // ç™»å‡º1,令牌放header中
    function logout1() {
      $.ajax({
        headers: {
          token: "b6d650b7-8eff-41f6-9fc7-8ec1c73cd567"
        },
        url: "http://127.0.0.1:12316/server/sign/logout",
        type: "GET",
        data: null,
        dataType: "json",
        contentType: "application/json",
        success: function (rs) {
          console.log(rs);
        },
        error: function (e) {
          console.error(e);
        }
      });
    }
    // ç™»å‡º1,令牌放url中
    function logout2() {
      $.ajax({
        url: "http://127.0.0.1:12316/server/sign/logout?token=" + "b6d650b7-8eff-41f6-9fc7-8ec1c73cd567",
        type: "GET",
        data: null,
        dataType: "json",
        contentType: "application/json",
        success: function (rs) {
          console.log(rs);
        },
        error: function (e) {
          console.error(e);
        }
      });
    }
    // æ£€æŸ¥æ˜¯/否登录
    function check() {
      $.ajax({
        url: "http://127.0.0.1:12316/server/sign/check?token=" + "b6d650b7-8eff-41f6-9fc7-8ec1c73cd567",
        type: "GET",
        data: null,
        dataType: "json",
        contentType: "application/json",
        success: function (rs) {
          console.log(rs);
        },
        error: function (e) {
          console.error(e);
        }
      });
    }
    // æ˜¯/否为管理员
    function isAdmin() {
      $.ajax({
        url: "http://127.0.0.1:12316/server/user/selectForIsAdmin?token=" + "b6d650b7-8eff-41f6-9fc7-8ec1c73cd567",
        type: "GET",
        data: null,
        dataType: "json",
        contentType: "application/json",
        success: function (rs) {
          console.log(rs);
        },
        error: function (e) {
          console.error(e);
        }
      });
    }
    // æ ¹æ®æ•°æ®åº“ID获取用户
    function getUserById() {
      $.ajax({
        url: "http://127.0.0.1:12316/server/user/selectUser?token=" + "b6d650b7-8eff-41f6-9fc7-8ec1c73cd567" + "&id=1",
        type: "GET",
        data: null,
        dataType: "json",
        contentType: "application/json",
        success: function (rs) {
          console.log(rs);
        },
        error: function (e) {
          console.error(e);
        }
      });
    }
    // æ ¹æ®ç™»å½•ID获取用户
    function getUserByUid() {
      $.ajax({
        url: "http://127.0.0.1:12316/server/user/selectByUid?token=" + "b6d650b7-8eff-41f6-9fc7-8ec1c73cd567" + "&uid=admin",
        type: "GET",
        data: null,
        dataType: "json",
        contentType: "application/json",
        success: function (rs) {
          console.log(rs);
        },
        error: function (e) {
          console.error(e);
        }
      });
    }
    // èŽ·å–ç”¨æˆ·åˆ—è¡¨
    function selectUsers() {
      $.ajax({
        url: "http://127.0.0.1:12316/server/user/selectByPageAndCount?token=" + "b6d650b7-8eff-41f6-9fc7-8ec1c73cd567" + "&uname=&pageSize=10&pageIndex=1",
        type: "GET",
        data: null,
        dataType: "json",
        contentType: "application/json",
        success: function (rs) {
          console.log(rs);
        },
        error: function (e) {
          console.error(e);
        }
      });
    }
    // æ˜¯/否为管理员
    function isAdmin2() {
      $.ajax({
        url: "http://127.0.0.1:12316/server/user/selectIsAdmin?token=" + "b6d650b7-8eff-41f6-9fc7-8ec1c73cd567" + "&id=1",
        type: "GET",
        data: null,
        dataType: "json",
        contentType: "application/json",
        success: function (rs) {
          console.log(rs);
        },
        error: function (e) {
          console.error(e);
        }
      });
    }
    // èŽ·å–ç®¡ç†å‘˜ç”¨æˆ·
    function selectAdminUsers() {
      $.ajax({
        url: "http://127.0.0.1:12316/server/user/selectAdminUsers?token=" + "b6d650b7-8eff-41f6-9fc7-8ec1c73cd567" + "&type=1",
        type: "GET",
        data: null,
        dataType: "json",
        contentType: "application/json",
        success: function (rs) {
          console.log(rs);
        },
        error: function (e) {
          console.error(e);
        }
      });
    }
    // èŽ·å–ç”¨æˆ·çš„è§’è‰²ä¿¡æ¯
    function selectRoleByUserId() {
      $.ajax({
        url: "http://127.0.0.1:12316/server/user/selectRoleByUserId?token=" + "b6d650b7-8eff-41f6-9fc7-8ec1c73cd567" + "&id=1",
        type: "GET",
        data: null,
        dataType: "json",
        contentType: "application/json",
        success: function (rs) {
          console.log(rs);
        },
        error: function (e) {
          console.error(e);
        }
      });
    }
    // èŽ·å–å•ä¸ªè§’è‰²ä¿¡æ¯
    function selectRoleById() {
      $.ajax({
        url: "http://127.0.0.1:12316/server/role/selectRole?token=" + "b6d650b7-8eff-41f6-9fc7-8ec1c73cd567" + "&id=1",
        type: "GET",
        data: null,
        dataType: "json",
        contentType: "application/json",
        success: function (rs) {
          console.log(rs);
        },
        error: function (e) {
          console.error(e);
        }
      });
    }
    // èŽ·å–è§’è‰²åˆ—è¡¨
    function selectRoles() {
      $.ajax({
        url: "http://127.0.0.1:12316/server/role/selectByPageAndCount?token=" + "b6d650b7-8eff-41f6-9fc7-8ec1c73cd567" + "&name=&depid=&pageSize=10&pageIndex=1",
        type: "GET",
        data: null,
        dataType: "json",
        contentType: "application/json",
        success: function (rs) {
          console.log(rs);
        },
        error: function (e) {
          console.error(e);
        }
      });
    }
    // èŽ·å–è§’è‰²ä¸‹çš„ç”¨æˆ·ä¿¡æ¯
    function selectUserByRoleId() {
      $.ajax({
        url: "http://127.0.0.1:12316/server/user/selectUserByRoleId?token=" + "b6d650b7-8eff-41f6-9fc7-8ec1c73cd567" + "&id=1",
        type: "GET",
        data: null,
        dataType: "json",
        contentType: "application/json",
        success: function (rs) {
          console.log(rs);
        },
        error: function (e) {
          console.error(e);
        }
      });
    }
  </script>
</head>
<body>
  ä¸Šä¼ è·¯å¾„:<span id="pathSpan"></span>,当前令牌:<span id="tokenSpan"></span>
</body>
</html>
ExportMap/up.html
@@ -10,7 +10,7 @@
    var app = {};
    var path = "20221128010101";
    var url = "http://127.0.0.1:12316/server/";
    var token = "f174edc5-8640-4490-a159-e2d181d2cef7";
    var token = "e62f5887-a398-4362-8bc1-7dd11b81e42e";
    $(function () {
      $("#pathSpan").html(path);
@@ -455,7 +455,7 @@
    function aesDecrypt(word) {
      return CryptoJS.enc.Utf8.stringify(CryptoJS.AES.decrypt(word, CryptoJS.enc.Utf8.parse(base64Decode("QSNzX2xGX3NFcnZlX2sueQ==")), { mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7 })).toString();
    }
  </script>
  </script>
  <script>
    function selectDbOverflowDep() {
      var obj = {