|
@@ -1,4 +1,7 @@
|
|
|
|
+import hashlib
|
|
import os
|
|
import os
|
|
|
|
+import uuid
|
|
|
|
+
|
|
import simplejson as json
|
|
import simplejson as json
|
|
import time
|
|
import time
|
|
from django.utils import timezone
|
|
from django.utils import timezone
|
|
@@ -311,14 +314,17 @@ class EquipmentVersionView(View):
|
|
url = SERVER_DOMAIN + 'OTA/downloads/' + path
|
|
url = SERVER_DOMAIN + 'OTA/downloads/' + path
|
|
elif file_path.find('static/otapack') != -1:
|
|
elif file_path.find('static/otapack') != -1:
|
|
file_path = file_path
|
|
file_path = file_path
|
|
|
|
+ param_url = "ansjer/" + CommonService.RandomStr(6) + "/" + file_path
|
|
|
|
+ data = {'Url': param_url, 'user_id': '', 'uid': uid, 'serial_number': '', 'old_version': '',
|
|
|
|
+ 'new_version': '', 'mci': ''}
|
|
|
|
+ dvr_ota_key = 'ASJ:SERVER:VERSION:{}'.format(uid)
|
|
|
|
+ dvr_ota_value = json.dumps(data)
|
|
|
|
+ expire = 3600 * 24 * 2 + 600
|
|
|
|
+ redisObject.set_data(dvr_ota_key, dvr_ota_value, expire)
|
|
# 创建url的token
|
|
# 创建url的token
|
|
tko = UrlTokenObject()
|
|
tko = UrlTokenObject()
|
|
- file_path = tko.generate(data={'Url': "ansjer/" + CommonService.RandomStr(6) + "/" + file_path})
|
|
|
|
-
|
|
|
|
|
|
+ file_path = tko.generate(data={'uid': uid})
|
|
url = SERVER_DOMAIN + 'dlotapack/' + file_path
|
|
url = SERVER_DOMAIN + 'dlotapack/' + file_path
|
|
- else:
|
|
|
|
- return response.json(900, '2')
|
|
|
|
- # http: // 192.168.136.39:8000 / EquipmentVersion / checkVer?code = 20D20410010
|
|
|
|
|
|
|
|
res = {
|
|
res = {
|
|
"url": url,
|
|
"url": url,
|