From 8608f7fc85a0caada59f1d8887994418df16b370 Mon Sep 17 00:00:00 2001
From: rain <167982779@qq.com>
Date: Mon, 02 Dec 2024 17:23:41 +0800
Subject: [PATCH] 遥控器上云

---
 src/pages/page-pilot/pilot-home.vue |    7 +++----
 src/api/http/config.ts              |    5 +++--
 src/api/pilot-bridge.ts             |    2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/api/http/config.ts b/src/api/http/config.ts
index 6fca374..7f9c2fe 100644
--- a/src/api/http/config.ts
+++ b/src/api/http/config.ts
@@ -10,14 +10,15 @@
   // baseURL: 'http://192.168.1.133:6789', // This url must end with "/". Example: 'http://192.168.1.1:6789/'
   baseURL: 'http://192.168.1.198:6789', // This url must end with "/". Example: 'http://192.168.1.1:6789/'
   // ws: 'ws//127.0.0.1:6789/api/v1/ws',
+  ws: 'wss://wrj.shuixiongit.com/drone-wss/api/v1/ws',
   // ws://192.168.1.198:1883/
-  websocketURL: 'ws://192.168.1.198:6789/api/v1/ws', // Example: 'ws://192.168.1.198:6789/api/v1/ws'
+  websocketURL: 'ws://192.168.1.114:6790/api/v1/ws', // Example: 'ws://192.168.1.198:6789/api/v1/ws'
   // websocketURL: 'ws://192.168.1.133:6789/api/v1/ws', // Example: 'ws://192.168.1.198:6789/api/v1/ws'
   // websocketURL: 'wss://dev.jxpskj.com:36789/api/v1/ws', // Example: 'ws://192.168.1.198:6789/api/v1/ws'
 
   // livestreaming
   // RTMP  Note: This IP is the address of the streaming server. If you want to see livestream on web page, you need to convert the RTMP stream to WebRTC stream.
-  rtmpURL: 'rtmp://www.ainfo.top:735/uav/', // Example: 'rtmp://192.168.1.1/live/'
+  rtmpURL: 'rtmp://139.196.74.78/live/', // Example: 'rtmp://192.168.1.1/live/'
   // GB28181 Note:If you don't know what these parameters mean, you can go to Pilot2 and select the GB28181 page in the cloud platform. Where the parameters same as these parameters.
   // gbServerIp: '171.34.76.175',
   // gbServerPort: '15060',
diff --git a/src/api/pilot-bridge.ts b/src/api/pilot-bridge.ts
index 86af3e2..34dc63e 100644
--- a/src/api/pilot-bridge.ts
+++ b/src/api/pilot-bridge.ts
@@ -236,7 +236,7 @@
     return window.djiBridge.wsConnect(host, token, callback)
   },
   wsDisconnect (): string {
-    return window.djiBridge.wsConnect()
+    return window.djiBridge.wsDisconnect()
   },
   wsSend (message: string): string {
     return window.djiBridge.wsSend(message)
diff --git a/src/pages/page-pilot/pilot-home.vue b/src/pages/page-pilot/pilot-home.vue
index 6377678..9e40e8d 100644
--- a/src/pages/page-pilot/pilot-home.vue
+++ b/src/pages/page-pilot/pilot-home.vue
@@ -295,8 +295,8 @@
       connectCallback: 'connectCallback'
     }
     components.set(EComponentName.Thing, param)
+    components.set(EComponentName.Ws, param)
     apiPilot.loadComponent(EComponentName.Thing, components.get(EComponentName.Thing))
-
     bindParam.device_sn = device.data.gateway_sn
     bindParam.user_id = res.data.user_id
     bindParam.workspace_id = res.data.workspace_id
@@ -464,20 +464,19 @@
     }
     case EComponentName.Ws: {
       const wsParam: WsParam = components.get(EComponentName.Ws)
-      wsParam.token = '' + localStorage.getItem(ELocalStorageKey.Token)
+      wsParam.token = '' + localStorage.getItem(ELocalStorageKey.Token)?.replace('bearer ', '')
       param = wsParam
       break
     }
     default:
       param = components.get(m.module)
   }
-
   components.set(m.module, param)
   console.info(components.get(m.module))
   apiPilot.loadComponent(m.module, components.get(m.module))
+
   refreshStatus()
 }
-
 function moduleUninstall (m: any) {
   message.info('卸载 ' + m.module)
   apiPilot.unloadComponent(m.module)

--
Gitblit v1.9.3