zhangdongming 3 жил өмнө
parent
commit
c075476491

+ 11 - 3
Controller/OTAEquipment.py

@@ -533,8 +533,7 @@ def getNewVerInterface(request):
         ver = equipment.softwareVersion
         max_ver = equipment.max_ver
         print(now_ver <= max_ver)
-        str_uuid = "".join(str(uuid.uuid4()).split("-")).upper()
-        device_info_key = 'ASJ:SERVER:DEVICE:VERSION:{}'.format(str_uuid)
+
         now_stamp = int(time.time())
         if now_ver <= max_ver:
             # 创建url的token
@@ -544,6 +543,15 @@ def getNewVerInterface(request):
                     'new_version': version, 'mci': mci}
             device_info_value = json.dumps(data)
             expire = 3600 * 24 * 2 + 600 + now_stamp
+
+            str_uuid = str(tko.userID)
+            if serial_number:
+                str_uuid += serial_number
+            elif uid:
+                str_uuid += uid
+            str_uuid += now_ver
+            device_info_key = 'ASJ:SERVER:VERSION:{}'.format(str_uuid)
+            logger.info('缓存key={}', device_info_key)
             redisObject.set_data(device_info_key, device_info_value, expire)
 
             url_tko = UrlTokenObject()
@@ -690,7 +698,7 @@ def downloadOTAInterfaceV2(request, fullPath, *callback_args, **callback_kwargs)
     logger.info('<<<<<进入OTA下载')
     redis_object = RedisObject()
     logger.info(str_uuid)
-    device_key = 'ASJ:SERVER:DEVICE:VERSION:{}'.format(str_uuid)
+    device_key = 'ASJ:SERVER:VERSION:{}'.format(str_uuid)
     device_value = redis_object.get_data(device_key)
     logger.info(device_value)
     if not device_value: