diff --git a/src/utils/mqttConfig.js b/src/utils/mqttConfig.js index 40b9020..a6fcb82 100644 --- a/src/utils/mqttConfig.js +++ b/src/utils/mqttConfig.js @@ -13,13 +13,13 @@ class mqttHandle { cleanSession: true, connectTimeout: 7000, // 超时时间 reconnectPeriod: 7000, // 重连时间间隔 - host: '175.27.191.156', - port: '10083', + host: '138.227.111.141', + port: '8083', // 认证信息 // clientId: Number(new Date()).toString(), - clientId: 'mqttjs_23dda38f34', - username: "site", - password: "site", + clientId: 'JBFY', + username: "admin", + password: "123456", } // this.subscription = { // topic: subscribe, //需要传入数组的包含订阅的名称 @@ -35,7 +35,7 @@ class mqttHandle { //配置链接 const { host, port, endpoint, ...options } = this.connect; console.log("this.connect.host", this.connect.host) - const connectUrl = 'ws://175.27.191.156:10083/mqtt'; + const connectUrl = 'ws://138.227.111.141:8083/mqtt'; // const connectUrl = `ws://${this.connect.host}:${this.connect.port}`; // if (!client.connected) { // client.on('connect', function () { diff --git a/src/views/energySaving.vue b/src/views/energySaving.vue index 7a9005a..c2e5263 100644 --- a/src/views/energySaving.vue +++ b/src/views/energySaving.vue @@ -309,7 +309,7 @@ export default { //mqtt订阅数据 createMqtt() { //创建链接,接收数据 - let topicSends = ["/SC/pub/uwb", "/SC/pub/env"]; + let topicSends = ["device/publish/FB80"]; window.PubScribe(topicSends, this.realInfo); }, /** 实时数据分类 */ @@ -317,7 +317,7 @@ export default { let that = this; switch (topic) { // 接收托片 - case "/SC/pub/uwb": + case "device/publish/FB80": try { const utf8decoder = new TextDecoder(); const u8arr = new Uint8Array(message);