Browse Source

修改check_time_stamp_token_without_distance函数参数顺序

locky 3 years ago
parent
commit
e3e9e34f25
2 changed files with 3 additions and 3 deletions
  1. 1 1
      SensorGateway/SensorGatewayController.py
  2. 2 2
      Service/CommonService.py

+ 1 - 1
SensorGateway/SensorGatewayController.py

@@ -51,7 +51,7 @@ class SensorGateway(View):
             return response.json(444, {'param': 'time_stamp, time_stamp_token'})
         try:
             # 时间戳token校验
-            if not CommonService.check_time_stamp_token_without_distance(time_stamp, time_stamp_token):
+            if not CommonService.check_time_stamp_token_without_distance(time_stamp_token, time_stamp):
                 return response.json(13)
 
             sensor_id = ''.join(random.sample(string.ascii_letters + string.digits, 6))

+ 2 - 2
Service/CommonService.py

@@ -455,7 +455,7 @@ class CommonService:
             return False
 
     @staticmethod
-    def check_time_stamp_token_without_distance(time_stamp, time_stamp_token):
+    def check_time_stamp_token_without_distance(time_stamp_token, time_stamp):
         """
         用于没有RTC设备的时间戳token校验
         @param time_stamp: 时间戳
@@ -463,7 +463,7 @@ class CommonService:
         @return: boolean True/False
         """
 
-        if not all([time_stamp, time_stamp_token]):
+        if not all([time_stamp_token, time_stamp]):
             return False
         try:
             token = CommonService.decode_data(time_stamp_token)