This commit is contained in:
张成
2025-12-15 18:36:20 +08:00
parent c083494fce
commit 6e5c35f144
15 changed files with 867 additions and 8 deletions

View File

@@ -97,6 +97,18 @@ class MqttDispatcher {
});
}
// 检查授权状态(对于需要授权的操作)
const authorizationService = require('../../services/authorization_service');
const authCheck = await authorizationService.checkAuthorization(deviceCode, 'sn_code');
if (!authCheck.is_authorized) {
console.log(`[MQTT分发器] 设备 ${deviceCode} 授权检查失败: ${authCheck.message}`);
return this.sendMqttResponse(mqttClient, uuid, {
code: 403,
message: authCheck.message,
data: null
});
}
// 获取对应的处理器
const handler = this.actionHandlers.get(action);
if (!handler) {