Ver código fonte

校验开始时间和结束时间

peng 1 ano atrás
pai
commit
1965a29b9a
1 arquivos alterados com 2 adições e 0 exclusões
  1. 2 0
      Controller/SensorGateway/SmartSwitchController.py

+ 2 - 0
Controller/SensorGateway/SmartSwitchController.py

@@ -246,6 +246,8 @@ class SmartSwitchView(View):
                 return response.json(444, {'param': 'startTime,endTime'})
             start_time = int(start_time)
             end_time = int(end_time)
+            if start_time >= 86400 or end_time > 86400 or start_time == end_time:
+                return response.json(444, {'param': 'startTime,endTime'})
             scheduler_data = {
                 'device_id': device_id,
                 'time_type_radio': time_type_radio,