From 7d9fb50b4e444ba3afec098ad031e93b4e9ee9ee Mon Sep 17 00:00:00 2001
From: GuLiMmo <2820890765@qq.com>
Date: Wed, 29 Nov 2023 10:20:26 +0800
Subject: [PATCH] 航线库修改/api打包后可修改

---
 src/mqtt/config.ts |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/mqtt/config.ts b/src/mqtt/config.ts
index 7f91a74..0ca8331 100644
--- a/src/mqtt/config.ts
+++ b/src/mqtt/config.ts
@@ -2,16 +2,18 @@
   IClientOptions,
 } from 'mqtt'
 
+const { mqttConfig: { clientId, username, password, host, protocol, port } } = window.globalApiConfig
+
 export const OPTIONS: IClientOptions = {
   clean: true, // true: 清除会话, false: 保留会话
   connectTimeout: 10000, // mqtt 超时时间
   resubscribe: true, // 断开重连后,再次订阅原订阅
   reconnectPeriod: 10000, // 重连间隔时间: 5s
   keepalive: 5, // 心跳间隔时间:1s
-  clientId: 'DroneWeb',
-  username: 'root',
-  password: 'root',
-  host: '182.106.212.58',
-  protocol: 'ws',
-  port: 35675,
+  clientId: clientId || 'DroneWeb',
+  username: username || 'root',
+  password: password || 'root',
+  host: host || '182.106.212.58',
+  protocol: protocol || 'ws',
+  port: port || 35675,
 }

--
Gitblit v1.9.3