From f27ca082eb0a839449dd50c49007b58e5ed6946f Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Thu, 19 Jun 2025 19:08:01 +0800
Subject: [PATCH] feat: 服务名修改
---
src/mqtt/config.ts | 28 +++++++++++++++++-----------
1 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/src/mqtt/config.ts b/src/mqtt/config.ts
index 0ca8331..44edae5 100644
--- a/src/mqtt/config.ts
+++ b/src/mqtt/config.ts
@@ -1,8 +1,13 @@
-import {
- IClientOptions,
-} from 'mqtt'
-
-const { mqttConfig: { clientId, username, password, host, protocol, port } } = window.globalApiConfig
+/*
+ * @Author: GuLiMmo 2820890765@qq.com
+ * @Date: 2024-03-12 18:01:28
+ * @LastEditors: GuLiMmo 2820890765@qq.com
+ * @LastEditTime: 2024-08-27 16:17:01
+ * @FilePath: /drone-web/src/mqtt/config.ts
+ * @Description: mqtt配置
+ * Copyright (c) 2024 by GuLiMmo, All Rights Reserved.
+ */
+import { IClientOptions } from 'mqtt'
export const OPTIONS: IClientOptions = {
clean: true, // true: 清除会话, false: 保留会话
@@ -10,10 +15,11 @@
resubscribe: true, // 断开重连后,再次订阅原订阅
reconnectPeriod: 10000, // 重连间隔时间: 5s
keepalive: 5, // 心跳间隔时间:1s
- clientId: clientId || 'DroneWeb',
- username: username || 'root',
- password: password || 'root',
- host: host || '182.106.212.58',
- protocol: protocol || 'ws',
- port: port || 35675,
+ clientId: window?.globalApiConfig?.mqttConfig?.clientId || 'DroneWeb',
+ username: window?.globalApiConfig?.mqttConfig?.username || 'root',
+ password: window?.globalApiConfig?.mqttConfig?.password || 'root',
+ host: window?.globalApiConfig?.mqttConfig?.host || '139.196.74.78',
+ protocol: window?.globalApiConfig?.mqttConfig?.protocol || 'wss',
+ // 8083
+ port: window?.globalApiConfig?.mqttConfig?.port || 8084,
}
--
Gitblit v1.9.3