zhangdongming 3 жил өмнө
parent
commit
8a1202c9a1

+ 4 - 3
Controller/OTAEquipment.py

@@ -538,8 +538,8 @@ def getNewVerInterface(request):
         now_stamp = int(time.time())
         if now_ver <= max_ver:
             # 创建url的token
-
-            data = {'Url': "ansjer/" + CommonService.RandomStr(6) + "/" + file_path, 'user_id': tko.userID,
+            param_url = "ansjer/" + CommonService.RandomStr(6) + "/" + file_path
+            data = {'Url': param_url, 'user_id': tko.userID,
                     'uid': uid, 'serial_number': serial_number, 'old_version': "V" + now_ver + "." + code,
                     'new_version': version, 'mci': mci}
             device_info_value = json.dumps(data)
@@ -547,7 +547,7 @@ def getNewVerInterface(request):
             redisObject.set_data(device_info_key, device_info_value, expire)
 
             url_tko = UrlTokenObject()
-            file_path = url_tko.generate(data={'uid': device_info_key})
+            file_path = url_tko.generate(data={'Url': param_url, 'uid': device_info_key})
 
             url = SERVER_DOMAIN + 'dlotapack/' + file_path
             logger.info('<<<<<<<获取ota token={}'.format(file_path))
@@ -678,6 +678,7 @@ def downloadOTAInterfaceV2(request, fullPath, *callback_args, **callback_kwargs)
     # print('fullPath:%s' % fullPath)
     # 解密url的token
     url_token = UrlTokenObject(fullPath)
+
     # fp = url_token.Url
     # serial_number = url_token.serial_number
     # uid = url_token.uid