|
@@ -305,13 +305,13 @@ class EquipmentVersionView(View):
|
|
if not uids.__contains__(uid):
|
|
if not uids.__contains__(uid):
|
|
return response.json(902)
|
|
return response.json(902)
|
|
file_path = eqs[0].filePath
|
|
file_path = eqs[0].filePath
|
|
|
|
+ url = SERVER_DOMAIN
|
|
if file_path.find('static/Upgrade/') != -1:
|
|
if file_path.find('static/Upgrade/') != -1:
|
|
- path = file_path.replace('static/Upgrade/', '').replace('\\', '/')
|
|
|
|
# 创建url的token
|
|
# 创建url的token
|
|
tko = UrlTokenObject()
|
|
tko = UrlTokenObject()
|
|
path = tko.generate(data={'Url': "ansjer/" + CommonService.RandomStr(6) + "/" + file_path})
|
|
path = tko.generate(data={'Url': "ansjer/" + CommonService.RandomStr(6) + "/" + file_path})
|
|
|
|
|
|
- url = SERVER_DOMAIN + 'OTA/downloads/' + path
|
|
|
|
|
|
+ url += '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
|
|
param_url = "ansjer/" + CommonService.RandomStr(6) + "/" + file_path
|
|
@@ -319,12 +319,12 @@ class EquipmentVersionView(View):
|
|
'new_version': eqs[0].softwareVersion, 'mci': 'NVR'}
|
|
'new_version': eqs[0].softwareVersion, 'mci': 'NVR'}
|
|
dvr_ota_key = 'ASJ:SERVER:VERSION:{}'.format(uid)
|
|
dvr_ota_key = 'ASJ:SERVER:VERSION:{}'.format(uid)
|
|
dvr_ota_value = json.dumps(data)
|
|
dvr_ota_value = json.dumps(data)
|
|
- expire = 3600 * 24 * 2 + 600
|
|
|
|
|
|
+ expire = 600
|
|
redisObject.set_data(dvr_ota_key, dvr_ota_value, expire)
|
|
redisObject.set_data(dvr_ota_key, dvr_ota_value, expire)
|
|
# 创建url的token
|
|
# 创建url的token
|
|
tko = UrlTokenObject()
|
|
tko = UrlTokenObject()
|
|
file_path = tko.generate(data={'uid': uid})
|
|
file_path = tko.generate(data={'uid': uid})
|
|
- url = SERVER_DOMAIN + 'dlotapack/' + file_path
|
|
|
|
|
|
+ url += 'dlotapack/' + file_path
|
|
|
|
|
|
res = {
|
|
res = {
|
|
"url": url,
|
|
"url": url,
|