64 lines
2.4 KiB
HTML
64 lines
2.4 KiB
HTML
<!doctype html>
|
||
<html lang="en">
|
||
|
||
<head>
|
||
<meta charset="UTF-8" />
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||
<link rel="icon" type="image/x-icon" href="./src/assets/logo.png" />
|
||
<title>光伏电站智能监控与运维系统</title>
|
||
|
||
<!-- 预加载关键域名(提速DNS) -->
|
||
<link rel="dns-prefetch" href="https://cdnjs.cloudflare.com">
|
||
<link rel="dns-prefetch" href="https://unpkg.com">
|
||
<link rel="dns-prefetch" href="https://cdn.jsdelivr.net">
|
||
<link rel="dns-prefetch" href="https://lf-unpkg.volccdn.com">
|
||
|
||
<!-- CSS 异步加载,不阻塞页面渲染 -->
|
||
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" media="print"
|
||
onload="this.media='all'">
|
||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/cesium@latest/Build/Cesium/Widgets/widgets.css"
|
||
media="print" onload="this.media='all'">
|
||
<link rel="stylesheet"
|
||
href="https://lf-unpkg.volccdn.com/obj/vcloudfe/sdk/@volcengine/veplayer/2.11.2/umd/veplayer.production.css"
|
||
media="print" onload="this.media='all'">
|
||
<script src="/js/jswebrtc.min.js"></script>
|
||
<script src="/js/jswebrtcnew.js"></script>
|
||
</head>
|
||
|
||
<body>
|
||
<div id="root"></div>
|
||
|
||
<script type="module" src="/src/main.tsx"></script>
|
||
|
||
<!-- ========== 所有大库 延迟异步加载 ========== -->
|
||
<script>
|
||
// 等页面加载完成后,再异步加载地图/视频库,不阻塞首屏
|
||
window.addEventListener('DOMContentLoaded', () => {
|
||
const loadScript = (src) => {
|
||
return new Promise((resolve) => {
|
||
const s = document.createElement('script');
|
||
s.src = src;
|
||
s.async = true;
|
||
s.onload = resolve;
|
||
document.body.appendChild(s);
|
||
});
|
||
};
|
||
|
||
// 按顺序加载
|
||
Promise.resolve()
|
||
//.then(() => loadScript('/js/jswebrtc.min.js'))
|
||
//.then(() => loadScript('/js/jswebrtcnew.js'))
|
||
.then(() => loadScript('https://unpkg.com/leaflet@1.9.4/dist/leaflet.js'))
|
||
.then(() => loadScript('https://cdn.jsdelivr.net/npm/cesium@latest/Build/Cesium/Cesium.js'))
|
||
.then(() => loadScript('https://cdn.jsdelivr.net/npm/hls.js@1.5.8/dist/hls.min.js'))
|
||
.then(() => loadScript('https://lf-unpkg.volccdn.com/obj/vcloudfe/sdk/@volcengine/veplayer/2.11.2/umd/veplayer.production.js'))
|
||
.then(() => {
|
||
console.log('✅ 所有地图/视频SDK加载完成');
|
||
window.CESIUM_BASE_URL = "https://cdnjs.cloudflare.com/ajax/libs/cesium/1.114.0/";
|
||
});
|
||
});
|
||
</script>
|
||
</body>
|
||
|
||
</html>
|