This commit is contained in:
张成
2025-12-30 17:06:14 +08:00
parent 914999c9fc
commit 52876229a8
3 changed files with 56 additions and 11 deletions

View File

@@ -29,12 +29,7 @@ class MqttSyncClient {
return;
}
// 记录日志但不包含敏感信息
const { maskSensitiveData } = require('../../utils/crypto_utils');
const safeMessage = maskSensitiveData(messageObj, ['password', 'pwd', 'token', 'secret', 'key', 'cookie']);
console.log('[MQTT] 收到消息', topic, '类型:', messageObj.action || messageObj.type || 'unknown');
// 优化:只通知相关 topic 的监听器,而不是所有监听器
// 1. 触发该 topic 的专用监听器
const topicListeners = this.messageListeners.get(topic);
if (topicListeners && topicListeners.size > 0) {