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 () {