Merge branch 'liubiao-new-20250827'

This commit is contained in:
2025-08-30 14:37:40 +08:00
18 changed files with 1350 additions and 443 deletions

View File

@ -170,7 +170,7 @@ class MqttClient {
potentialJsons.forEach(jsonString => {
if (jsonString.trim() === '') return;
if (this.messageCallbacks.has(topic)) {
this.messageCallbacks.get(topic)(jsonString);
this.messageCallbacks.get(topic)(jsonString,message);
}
});
};
@ -284,8 +284,10 @@ class MqttClient {
mqttMessage.qos = 1;
this.client.send(mqttMessage);
console.log(`成功发布消息到主题 ${topic}: ${message}`);
return true;
} else {
console.error('MQTT未连接无法发布');
return false;
}
}