From bb6f4ff31995d3e0acd8b18a288dedc31b0aa51b Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期二, 27 十二月 2022 10:29:06 +0800 Subject: [PATCH] 1 --- ExportMap/api.html | 310 +++++++++++++++++++++++++++++++++++++++++++++++++++ ExportMap/up.html | 4 ExportMap/ExportMap.csproj | 1 3 files changed, 313 insertions(+), 2 deletions(-) diff --git a/ExportMap/ExportMap.csproj b/ExportMap/ExportMap.csproj index 8b5c751..0407b69 100644 --- a/ExportMap/ExportMap.csproj +++ b/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" /> diff --git a/ExportMap/api.html b/ExportMap/api.html new file mode 100644 index 0000000..72820d8 --- /dev/null +++ b/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") // 瀵嗙爜锛孯SA鍔犲瘑 + }; + + $.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); + } + }); + } + + // 鏍规嵁鏁版嵁搴揑D鑾峰彇鐢ㄦ埛 + 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> diff --git a/ExportMap/up.html b/ExportMap/up.html index 90e20c9..bbc40e2 100644 --- a/ExportMap/up.html +++ b/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 = { -- Gitblit v1.9.3