mirror of
https://gitee.com/beecue/fastbee.git
synced 2025-12-18 00:45:55 +08:00
修复新增设备报错
This commit is contained in:
@@ -444,7 +444,8 @@ export default {
|
||||
} else {
|
||||
addDevice(this.form).then(response => {
|
||||
this.form = response.data;
|
||||
this.oldDeviceStatus = this.from.status;
|
||||
console.log(response);
|
||||
this.oldDeviceStatus = this.form.status;
|
||||
if (this.form.deviceId == null || this.form.deviceId == 0) {
|
||||
this.$modal.alertError("设备编号已经存在,添加设备失败");
|
||||
} else {
|
||||
|
||||
@@ -217,6 +217,7 @@ export default {
|
||||
this.MonitorChart();
|
||||
});
|
||||
});
|
||||
this.connectMqtt();
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -259,10 +260,16 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// 回调处理
|
||||
this.mqttCallback();
|
||||
|
||||
},
|
||||
methods: {
|
||||
/* 连接Mqtt消息服务器 */
|
||||
async connectMqtt() {
|
||||
if (this.$mqttTool.client == null) {
|
||||
await this.$mqttTool.connect(this.vuex_token);
|
||||
}
|
||||
this.mqttCallback();
|
||||
},
|
||||
/* Mqtt回调处理 */
|
||||
mqttCallback() {
|
||||
this.$mqttTool.client.on('message', (topic, message, buffer) => {
|
||||
|
||||
Reference in New Issue
Block a user