添加高德地图密钥

This commit is contained in:
jiayu 2025-02-26 15:57:09 +08:00
parent e9e25ad53d
commit 9fa14af042

View File

@ -1,179 +1,182 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<title><%- title %></title>
</head>
<head> <body>
<meta charset="UTF-8" /> <div id="app">
<link rel="icon" href="/favicon.ico" /> <style>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" /> html,
<title> body,
<%- title %> #app {
</title> width: 100%;
</head> overflow: hidden;
height: 100%;
max-height: 100%;
padding: 0;
margin: 0;
}
<body> .loading-box {
<div id="app"> display: flex;
<style> flex-direction: column;
html, align-items: center;
body, justify-content: center;
#app { width: 100%;
width: 100%; height: 100%;
overflow: hidden; }
height: 100%;
max-height: 100%; .loading-box .loading-wrap {
padding: 0; display: flex;
margin: 0; align-items: center;
} justify-content: center;
padding: 98px;
.loading-box { }
display: flex;
flex-direction: column; .dot {
align-items: center; position: relative;
justify-content: center; box-sizing: border-box;
width: 100%; display: inline-block;
height: 100%; width: 32px;
} height: 32px;
font-size: 32px;
.loading-box .loading-wrap { transform: rotate(45deg);
display: flex; animation: ant-rotate 1.2s infinite linear;
align-items: center; }
justify-content: center;
padding: 98px; .dot i {
} position: absolute;
display: block;
.dot { width: 14px;
position: relative; height: 14px;
box-sizing: border-box; background-color: #409eff;
display: inline-block; border-radius: 100%;
width: 32px; opacity: 0.3;
height: 32px; transform: scale(0.75);
font-size: 32px; transform-origin: 50% 50%;
transform: rotate(45deg); animation: ant-spin-move 1s infinite linear alternate;
animation: ant-rotate 1.2s infinite linear; }
}
.dot i:nth-child(1) {
.dot i { top: 0;
position: absolute; left: 0;
display: block; }
width: 14px;
height: 14px; .dot i:nth-child(2) {
background-color: #409eff; top: 0;
border-radius: 100%; right: 0;
opacity: 0.3; animation-delay: 0.4s;
transform: scale(0.75); }
transform-origin: 50% 50%;
animation: ant-spin-move 1s infinite linear alternate; .dot i:nth-child(3) {
} right: 0;
bottom: 0;
.dot i:nth-child(1) { animation-delay: 0.8s;
top: 0; }
left: 0;
} .dot i:nth-child(4) {
bottom: 0;
.dot i:nth-child(2) { left: 0;
top: 0; animation-delay: 1.2s;
right: 0; }
animation-delay: 0.4s;
} @keyframes ant-rotate {
to {
.dot i:nth-child(3) { transform: rotate(405deg);
right: 0; }
bottom: 0; }
animation-delay: 0.8s;
} @keyframes ant-spin-move {
to {
.dot i:nth-child(4) { opacity: 1;
bottom: 0; }
left: 0; }
animation-delay: 1.2s; </style>
} <div class="loading-box">
<div class="loading-wrap">
@keyframes ant-rotate { <span class="dot dot-spin"><i></i><i></i><i></i><i></i></span>
to { </div>
transform: rotate(405deg); </div>
} </div>
} <script>
const globalState = JSON.parse(window.localStorage.getItem("GlobalState"));
@keyframes ant-spin-move { if (globalState) {
to { const color = globalState.themeConfig.primary;
opacity: 1; const isDark = globalState.themeConfig.isDark;
} const dot = document.querySelectorAll(".dot i");
} const html = document.querySelector("html");
</style> dot.forEach(item => (item.style.background = color));
<div class="loading-box"> if (isDark) html.style.background = "#141414";
<div class="loading-wrap"> }
<span class="dot dot-spin"><i></i><i></i><i></i><i></i></span> // 高德地图自2021年12月02日升级升级之后所申请的 key 必须配备安全密钥 jscode 一起使用
</div> window._AMapSecurityConfig = { securityJsCode: "7375e94447ea4d636b3d12d639ba21ec" };
</div> </script>
</div> <script type="module" src="/src/main.ts"></script>
<script> <script
const globalState = JSON.parse(window.localStorage.getItem("GlobalState")); src="https://webapi.amap.com/maps?v=2.0&key=1eb65a4a1e436b5314d23b773cd4e658&plugin=AMap.Autocomplete,AMap.PlaceSearch,AMap.MouseTool,AMap.Geocoder,AMap.Driving"
if (globalState) { defer="defer"
const color = globalState.themeConfig.primary; ></script>
const isDark = globalState.themeConfig.isDark; <script src="/jquery-1.12.4.min.js"></script>
const dot = document.querySelectorAll(".dot i"); <!-- 用于前端与插件交互 -->
const html = document.querySelector("html"); <script src="/jsencrypt.min.js"></script>
dot.forEach(item => (item.style.background = color)); <!-- 用于RSA加密 -->
if (isDark) html.style.background = "#141414"; <script src="/jsWebControl-1.0.0.min.js"></script>
} <!-- 用于RSA加密 -->
</script> <!-- <script
<script type="module" src="/src/main.ts"></script>
<script src="https://webapi.amap.com/maps?v=2.0&key=1eb65a4a1e436b5314d23b773cd4e658&plugin=AMap.Autocomplete,AMap.PlaceSearch,AMap.MouseTool,AMap.Geocoder,AMap.Driving" defer="defer"></script>
<script src="/jquery-1.12.4.min.js"></script>
<!-- 用于前端与插件交互 -->
<script src="/jsencrypt.min.js"></script>
<!-- 用于RSA加密 -->
<script src="/jsWebControl-1.0.0.min.js"></script>
<!-- 用于RSA加密 -->
<!-- <script
type="text/javascript" type="text/javascript"
src="<%= BASE_URL %>lib/include-lib.js?time=20210329" src="<%= BASE_URL %>lib/include-lib.js?time=20210329"
libpath="<%= BASE_URL %>lib/" libpath="<%= BASE_URL %>lib/"
include="jquery,jquery.range,bootstrap,bootstrap-checkbox,font-awesome,web-icons,layer,haoutil,nprogress,toastr,admui,turf,cesium,mars3d,mars3d-widget" include="jquery,jquery.range,bootstrap,bootstrap-checkbox,font-awesome,web-icons,layer,haoutil,nprogress,toastr,admui,turf,cesium,mars3d,mars3d-widget"
></script> --> ></script> -->
<script src="https://static.bimface.com/api/BimfaceSDKLoader/BimfaceSDKLoader@latest-release.js" charset="utf-8"></script> <script src="https://static.bimface.com/api/BimfaceSDKLoader/BimfaceSDKLoader@latest-release.js" charset="utf-8"></script>
<script> <script>
// 禁用鼠标滚动事件 // 禁用鼠标滚动事件
document.addEventListener( document.addEventListener(
"keydown", "keydown",
function(event) { function (event) {
if ( if (
(event.ctrlKey === true || event.metaKey === true) && (event.ctrlKey === true || event.metaKey === true) &&
(event.which === 61 || (event.which === 61 ||
event.which === 107 || event.which === 107 ||
event.which === 173 || event.which === 173 ||
event.which === 109 || event.which === 109 ||
event.which === 187 || event.which === 187 ||
event.which === 189) event.which === 189)
) { ) {
event.preventDefault(); event.preventDefault();
} }
}, },
false false
); );
// Chrome IE 360 // Chrome IE 360
window.addEventListener( window.addEventListener(
"mousewheel", "mousewheel",
function(event) { function (event) {
if (event.ctrlKey === true || event.metaKey) { if (event.ctrlKey === true || event.metaKey) {
event.preventDefault(); event.preventDefault();
} }
}, { },
passive: false {
} passive: false
); }
);
//firefox
window.addEventListener(
"DOMMouseScroll",
function(event) {
if (event.ctrlKey === true || event.metaKey) {
event.preventDefault();
}
}, {
passive: false
}
);
</script>
</body>
//firefox
window.addEventListener(
"DOMMouseScroll",
function (event) {
if (event.ctrlKey === true || event.metaKey) {
event.preventDefault();
}
},
{
passive: false
}
);
</script>
</body>
</html> </html>