From 021d3cf3843ed11ef2d13684bac9bbb983e8a812 Mon Sep 17 00:00:00 2001 From: mmc <1556375442@qq.com> Date: Fri, 22 May 2026 08:03:30 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=86=E9=A2=91=E6=88=90=E5=8A=9F=20?= =?UTF-8?q?=E5=8E=9F=E5=9B=A0=20token=E5=8E=9F=E5=9B=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- env.js | 2 +- index.html | 6 +- src/components/Map.jsx | 22 ++-- src/components/VideoCanvas.tsx | 8 +- src/components/devices/DeviceStatusPage.tsx | 106 ++++++++++++++++---- src/components/useWebRTCStream.tsx | 4 +- 6 files changed, 108 insertions(+), 40 deletions(-) diff --git a/env.js b/env.js index 1306d9c..220600d 100644 --- a/env.js +++ b/env.js @@ -14,7 +14,7 @@ const envConfig = { WS_URL: 'ws://192.168.2.59:9002/ws/', }, [ENV.PROD]: { - // baseURL: 'http://192.168.2.56:8081', + //baseURL: 'https://pvcloudservice.satabot.com', baseURL: 'http://1.95.137.212:59015',//http://192.168.2.56:8081 //baseURL: 'https://serviceri.satabot.com', WS_URL: 'ws://1.95.137.212:59017/ws/' diff --git a/index.html b/index.html index 532a651..4aaa597 100644 --- a/index.html +++ b/index.html @@ -21,6 +21,8 @@ + +
@@ -44,8 +46,8 @@ // 按顺序加载 Promise.resolve() - .then(() => loadScript('/js/jswebrtc.min.js')) - .then(() => loadScript('/js/jswebrtcnew.js')) + //.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')) diff --git a/src/components/Map.jsx b/src/components/Map.jsx index 150c9d2..08f4d6b 100644 --- a/src/components/Map.jsx +++ b/src/components/Map.jsx @@ -107,7 +107,7 @@ export default function CesiumMap({ realtimePosition, pathPoints = [], devices = id, position: window.Cesium.Cartesian3.fromDegrees(p.lon, p.lat), point: { - color: window.Cesium.Color.SKYBLUE, + color: window.Cesium?.Color.SKYBLUE, pixelSize: 10, disableDepthTestDistance: Number.POSITIVE_INFINITY, }, @@ -115,7 +115,7 @@ export default function CesiumMap({ realtimePosition, pathPoints = [], devices = text: `${i + 1}`, font: '12px sans-serif', pixelOffset: new window.Cesium.Cartesian2(0, -15), - fillColor: window.Cesium.Color.WHITE + fillColor: window.Cesium?.Color.WHITE } }); pointEntitiesRef.current.push(id); @@ -133,7 +133,7 @@ export default function CesiumMap({ realtimePosition, pathPoints = [], devices = polyline: { positions: positions, width: 4, - material: window.Cesium.Color.SKYBLUE, + material: window.Cesium?.Color.SKYBLUE, clampToGround: true, } }); @@ -202,9 +202,9 @@ export default function CesiumMap({ realtimePosition, pathPoints = [], devices = positions: positions, width: 3, material: new Cesium.PolylineDashMaterialProperty({ - color: Cesium.Color.BLUE, + color: Cesium?.Color.BLUE, dashLength: 16, - gapColor: Cesium.Color.TRANSPARENT, + gapColor: Cesium?.Color.TRANSPARENT, }), clampToGround: true, disableDepthTestDistance: Number.POSITIVE_INFINITY, @@ -656,9 +656,9 @@ export default function CesiumMap({ realtimePosition, pathPoints = [], devices = text: robot.name, font: "14px sans-serif", pixelOffset: new window.Cesium.Cartesian2(0, -40), - fillColor: window.Cesium.Color.WHITE, + fillColor: window.Cesium?.Color.WHITE, showBackground: true, - backgroundColor: window.Cesium.Color.BLACK.withAlpha(0.6) + backgroundColor: window.Cesium?.Color.BLACK.withAlpha(0.6) } }); entity.robotData = robot; @@ -685,7 +685,7 @@ export default function CesiumMap({ realtimePosition, pathPoints = [], devices = }) }); viewerRef.current = viewer; - viewer.scene.globe.baseColor = window.Cesium.Color.BLACK; + viewer.scene.globe.baseColor = window.Cesium?.Color.BLACK; viewer.scene.globe.depthTestAgainstTerrain = false; viewer.scene.requestRenderMode = true; // 👈 加这个(只在需要时渲染) viewer.scene.globe.enableLighting = false; @@ -854,9 +854,9 @@ export default function CesiumMap({ realtimePosition, pathPoints = [], devices = text: device.name || "", font: "12px sans-serif", pixelOffset: new Cesium.Cartesian2(0, -40), - fillColor: Cesium.Color.WHITE, + fillColor: Cesium?.Color.WHITE, showBackground: true, - backgroundColor: Cesium.Color.BLACK.withAlpha(0.6) + backgroundColor: Cesium?.Color.BLACK.withAlpha(0.6) }, properties: { @@ -1259,7 +1259,7 @@ export default function CesiumMap({ realtimePosition, pathPoints = [], devices = material: new Cesium.PolylineGlowMaterialProperty({ glowPower: 0.25, - color: Cesium.Color.LIME + color: Cesium?.Color.LIME }), clampToGround: true, diff --git a/src/components/VideoCanvas.tsx b/src/components/VideoCanvas.tsx index 99a44c4..4e1a87c 100644 --- a/src/components/VideoCanvas.tsx +++ b/src/components/VideoCanvas.tsx @@ -151,13 +151,13 @@ const VideoCanvas: React.FC