From 4a0e44f51dafdc8ad4fe7ef11392bad128893a89 Mon Sep 17 00:00:00 2001 From: qiudan <1044775178@qq.com> Date: Sun, 7 Apr 2024 18:12:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9mqtt=E9=85=8D=E7=BD=AEport:80?= =?UTF-8?q?,connectUrl=E5=A2=9E=E5=8A=A0=E5=9B=BA=E5=AE=9A=E5=9C=B0?= =?UTF-8?q?=E5=9D=80endpoint:=20"/mqtt",?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/mqttConfig.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/mqttConfig.js b/src/utils/mqttConfig.js index 69821a2..b554060 100644 --- a/src/utils/mqttConfig.js +++ b/src/utils/mqttConfig.js @@ -21,7 +21,7 @@ class mqttHandle { connectTimeout: 5000, // 超时时间 reconnectPeriod: 3000, // 重连时间间隔 host: ip, - port: '10087', + port: '80', // 认证信息 // clientId: Number(new Date()).toString(), clientId: newName, @@ -52,9 +52,9 @@ class mqttHandle { } = this.connect; console.log("this.connect.host", this.connect.host) // const connectUrl = 'ws://172.16.1.168:10087/'; - let connectUrl = `ws://${this.connect.host}:${this.connect.port}`; + let connectUrl = `ws://${this.connect.host}${endpoint}`; if (process.env.NODE_ENV === 'development') { - connectUrl = 'ws://172.16.1.168:10087/'; + connectUrl = `ws://172.16.1.168${endpoint}`; } // if (!client.connected) { // client.on('connect', function () {