|
|
|
@ -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);
|
|
|
|
|
}
|
|
|
|
|
return NoDeviceInfoEvent(clientId,userName,password);
|
|
|
|
|
}catch (Exception ex){
|
|
|
|
|
logger.error("客户端认证逻辑处理异常:"+ex.getMessage());
|
|
|
|
|
}
|
|
|
|
|