change - broker 客户端认证逻辑修改

dev
Wen JY 1 year ago
parent cac6b971fb
commit 222201ef5b

@ -78,16 +78,16 @@ public class MqttAuthHandler implements IMqttServerAuthHandler {
//白名单过滤
if(clientIdWhitelist.contains(clientId)){
return true;
}
if(deviceInfoDtos!=null){
}else if (deviceInfoDtos!=null){
Optional<DeviceInfoDto> optionalDeviceInfoDto = deviceInfoDtos.stream().distinct().filter(x -> x.getDeviceCode().equals(clientId)).findFirst();
//判断本地集合中是否包含该设备信息如果不包含再次读取Redis并初始化本地集合
if (optionalDeviceInfoDto.isPresent()) {
DeviceInfoDto deviceInfo = optionalDeviceInfoDto.get();
return checkDeviceInfo(deviceInfo,clientId,userName,password);
}
}
}else {
return NoDeviceInfoEvent(clientId,userName,password);
}
}catch (Exception ex){
logger.error("客户端认证逻辑处理异常:"+ex.getMessage());
}

Loading…
Cancel
Save