Browse Source

优化语音广播设备请求失败问题

develop
Mr.Wang 5 months ago
parent
commit
d121cf4384
  1. 4
      zc-business/src/main/java/com/zc/business/controller/BroadcastController.java

4
zc-business/src/main/java/com/zc/business/controller/BroadcastController.java

@ -92,7 +92,7 @@ public class BroadcastController extends BaseController {
jsonResult = JSONObject.parseObject(response.body().string()); jsonResult = JSONObject.parseObject(response.body().string());
} }
} catch (SocketTimeoutException e) { } catch (SocketTimeoutException e) {
if (numberOfReconnections >3){ if (numberOfReconnections <3){
numberOfReconnections += 1; numberOfReconnections += 1;
getToken(); getToken();
return nearCamListDistance(params); return nearCamListDistance(params);
@ -100,9 +100,9 @@ public class BroadcastController extends BaseController {
jsonResult = new JSONObject(); jsonResult = new JSONObject();
jsonResult.put("code","400"); jsonResult.put("code","400");
jsonResult.put("msg","语音广播连接错误"); jsonResult.put("msg","语音广播连接错误");
return jsonResult;
} }
} }
numberOfReconnections = 0;
return jsonResult; return jsonResult;
} }

Loading…
Cancel
Save