TRX hace 1 año
padre
commit
45d62d67f2

+ 4 - 0
OneCardIotServer/src/main/java/com/zhongshu/iot/server/core/service/device/GateWayInfoService.java

@@ -275,6 +275,10 @@ public class GateWayInfoService extends SuperService {
                 return ResultContent.buildFail("gateWayId数据不存在");
             }
             registType = RegistType.Gateway;
+
+            if (!gateWayInfo.getMqttUserName().equals(param.getMqttUserName())) {
+                return ResultContent.buildFail("设备关联的连接账号与所属网关不匹配");
+            }
         } else {
             gateWayInfo = null;
             registType = RegistType.DirectConnection;

+ 1 - 1
OneCardIotServer/src/main/java/com/zhongshu/iot/server/core/service/iot/IotSendMessageService.java

@@ -198,7 +198,7 @@ public class IotSendMessageService extends SuperService {
         jsonObject.set("gateWayId", param.getGateWayId());
         jsonObject.set("event", "permissionNotice");
 
-        String topIc = "/v1/gateway/" + param.getGateWayId() + "/reply";
+        String topIc = "/gateway/" + param.getGateWayId() + "/reply";
         try {
             mqClient.sendObject(topIc, JSONUtil.toJsonStr(jsonObject), dataId);
         } catch (Exception e) {