TRX 1 tahun lalu
induk
melakukan
fdbc139e12

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

@@ -276,8 +276,8 @@ public class GateWayInfoService extends SuperService {
             }
             registType = RegistType.Gateway;
 
-            if (!gateWayInfo.getMqttUserName().equals(param.getMqttUserName())) {
-                return ResultContent.buildFail("设备关联的连接账号与所属网关不匹配");
+            if (StringUtils.isEmpty(gateWayInfo.getMqttUserName()) || !gateWayInfo.getMqttUserName().equals(param.getMqttUserName())) {
+                return ResultContent.buildFail("设备关联的连接账号与所属网关不匹配,注册失败");
             }
         } else {
             gateWayInfo = null;