|
@@ -15,7 +15,7 @@ from django.views.generic import TemplateView
|
|
|
from Ansjer.config import BASE_DIR, CONFIG_TEST
|
|
|
from Ansjer.config import SERVER_DOMAIN
|
|
|
from Model.models import Device_User, EquipmentVersionLimitModel, CountryIPModel, DeviceOTAUpgradeRecord, UidSetModel, \
|
|
|
- IPAddr
|
|
|
+ IPAddr, LogModel
|
|
|
from Model.models import Equipment_Version
|
|
|
from Object.RedisObject import RedisObject
|
|
|
from Object.ResponseObject import ResponseObject
|
|
@@ -789,6 +789,18 @@ def downloadOTAInterfaceV2(request, fullPath, *callback_args, **callback_kwargs)
|
|
|
uid=uid,
|
|
|
mci=mci,
|
|
|
)
|
|
|
+ ip = CommonService.get_ip_address(request)
|
|
|
+ content = json.loads(json.dumps(device_dist))
|
|
|
+ log = {
|
|
|
+ 'ip': ip,
|
|
|
+ 'user_id': 2,
|
|
|
+ 'status': 200,
|
|
|
+ 'time': int(time.time()),
|
|
|
+ 'url': 'dlotapack',
|
|
|
+ 'content': json.dumps(content),
|
|
|
+ 'operation': 'uid:{},旧版本{}升级为新版本{}'.format(uid, old_version, new_version),
|
|
|
+ }
|
|
|
+ LogModel.objects.create(**log)
|
|
|
return response
|
|
|
except Exception as e:
|
|
|
return res.json(906, repr(e))
|