代码提交

This commit is contained in:
lixiaobang 2023-04-14 18:08:20 +08:00
parent 6fc6118904
commit c4cdef7b3d
2 changed files with 8 additions and 8 deletions

View File

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

View File

@ -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);