mirror of
https://gitee.com/beecue/fastbee.git
synced 2025-12-17 08:25:53 +08:00
更新图片
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 64 KiB |
@@ -6,9 +6,9 @@ spring:
|
||||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
url: jdbc:mysql://${DB_HOST}/${DB_NAME}?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: ${DB_USER}
|
||||
password: ${DB_PASSWORD}
|
||||
url: jdbc:mysql://{DB_HOST}/{DB_NAME}?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: {DB_USER}
|
||||
password: {DB_PASSWORD}
|
||||
# 从库数据源
|
||||
slave:
|
||||
# 从数据源开关/默认关闭
|
||||
|
||||
@@ -133,7 +133,9 @@ public class ToolController extends BaseController {
|
||||
String[] clientInfo = clientid.split("&");
|
||||
if (clientInfo.length != 2) {
|
||||
// 设备未加密认证
|
||||
if (mqttConfig.getusername().equals(username) && mqttConfig.getpassword().equals(password)) {
|
||||
String deviceNum = clientInfo[0];
|
||||
Device device = deviceService.selectShortDeviceBySerialNumber(deviceNum);
|
||||
if (device !=null && mqttConfig.getusername().equals(username) && mqttConfig.getpassword().equals(password)) {
|
||||
System.out.println("-----------认证成功,clientId:" + clientid + "---------------");
|
||||
return ResponseEntity.ok().body("ok");
|
||||
}
|
||||
@@ -204,12 +206,12 @@ public class ToolController extends BaseController {
|
||||
|
||||
@ApiOperation("mqtt钩子处理")
|
||||
@PostMapping("/mqtt/webhook")
|
||||
public AjaxResult webHookProcess(@RequestBody MqttClientConnectModel model) {
|
||||
public void webHookProcess(@RequestBody MqttClientConnectModel model) {
|
||||
try {
|
||||
System.out.println("webhook:" + model.getAction());
|
||||
// 过滤服务端、web端和手机端
|
||||
if (model.getClientid().startsWith("server") || model.getClientid().startsWith("web") || model.getClientid().startsWith("phone")) {
|
||||
return AjaxResult.success();
|
||||
return;
|
||||
}
|
||||
String[] clientInfo = model.getClientid().split("&");
|
||||
String deviceNum = clientInfo[0];
|
||||
@@ -243,7 +245,6 @@ public class ToolController extends BaseController {
|
||||
ex.printStackTrace();
|
||||
log.error("发生错误:" + ex.getMessage());
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user