From aec00ecc093be803860c8675cbe1c4c776a7cb4e Mon Sep 17 00:00:00 2001
From: GuLiMmo <2820890765@qq.com>
Date: Tue, 19 Mar 2024 17:49:21 +0800
Subject: [PATCH] update: 新建航线、事件编辑、kmz文件问题修改

---
 src/mqtt/config.ts |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/mqtt/config.ts b/src/mqtt/config.ts
index 1af7df6..c3acd5b 100644
--- a/src/mqtt/config.ts
+++ b/src/mqtt/config.ts
@@ -1,12 +1,19 @@
-
 import {
   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: 1, // 心跳间隔时间:1s
+  keepalive: 5, // 心跳间隔时间:1s
+  clientId: clientId || 'DroneWeb',
+  username: username || 'root',
+  password: password || 'root',
+  host: host || '139.196.74.78',
+  protocol: protocol || 'ws',
+  port: port || 8083,
 }

--
Gitblit v1.9.3