|
@@ -1931,18 +1931,18 @@ export default {
|
|
|
// 连接错误处理
|
|
|
this.client.on("error", (error) => {
|
|
|
this.isMqtt=false;
|
|
|
+ if (this.client) {
|
|
|
+ this.client.end();
|
|
|
+ }
|
|
|
console.log("连接出错: ", error);
|
|
|
});
|
|
|
// 重新连接处理
|
|
|
- // this.client.on('reconnect', () => {
|
|
|
- // console.log('重新连接...')
|
|
|
- // })
|
|
|
+ this.client.on('reconnect', () => {
|
|
|
+ console.log('重新连接...')
|
|
|
+ })
|
|
|
this.client.on("close", () => {
|
|
|
console.log("监听断开连接");
|
|
|
this.isMqtt=false;
|
|
|
- if (this.client) {
|
|
|
- this.client.end();
|
|
|
- }
|
|
|
});
|
|
|
},
|
|
|
endTime() {
|