chenjunkai há 6 anos atrás
pai
commit
ae2ac4931f
3 ficheiros alterados com 0 adições e 31 exclusões
  1. 0 3
      Ansjer/urls.py
  2. 0 25
      Controller/OTAEquipment.py
  3. 0 3
      Service/middleware.py

+ 0 - 3
Ansjer/urls.py

@@ -118,9 +118,6 @@ urlpatterns = [
     url(r'^vodBucket/(?P<operation>.*)$', VodBucket.VodBucketView.as_view()),
     url(r'^UIDBucket/(?P<operation>.*)$', VodBucket.UidBucketView.as_view()),
     url(r'^EquipmentVersion/(?P<operation>.*)$', EquipmentOTA.EquipmentVersionView.as_view()),
-    # 新ota地址
-    url(r'^dl/otaPack/(?P<fullPath>[0-9\w/.\-]+)', OTAEquipment.dlOTAInterface),
-
     url(r'^deviceShare/(?P<operation>.*)$', DeviceShare.DeviceShareView.as_view()),
     url(r'^appVer/views$', AppInfo.AppVersionView.as_view()),
 

+ 0 - 25
Controller/OTAEquipment.py

@@ -564,28 +564,3 @@ def downloadOTAInterface(request, fullPath, *callback_args, **callback_kwargs):
         return res.json(444, 'fullPath')
 
 
-# 新ota包下载,上面的dvr被墙了
-@csrf_exempt
-def dlOTAInterface(request, fullPath, *callback_args, **callback_kwargs):
-    res = ResponseObject()
-    print('fullPath:')
-    print(fullPath)
-    if fullPath:
-        if os.path.isfile(fullPath):
-            try:
-                wrapper = FileWrapper(open(fullPath, 'rb'))
-                response = HttpResponse(wrapper, content_type="application/octet-stream")
-                response['Content-Length'] = os.path.getsize(fullPath)
-                response['Content-Disposition'] = 'attachment; filename=%s' % os.path.basename(fullPath)
-                response['Content-MD5'] = getMD5orSHA265(fullPath)
-                # 校验文件md5值
-                response['Content-SHA265'] = getMD5orSHA265(fullPath, 'SHA265')
-                response['Content-CRC32'] = getMD5orSHA265(fullPath, 'CRC32')
-                response['Content-Error'] = res.formal(0)
-                return response
-            except Exception as e:
-                return res.json(906, repr(e))
-        else:
-            return res.json(907)
-    else:
-        return res.json(444, 'fullPath')

+ 0 - 3
Service/middleware.py

@@ -23,9 +23,6 @@ class StatisticsUrlMiddleware(MiddlewareMixin):
         index = path.find('/OTA/downloads')
         if index != -1:
             addsCount = len(api_settings.ADDR_URL)
-            print('------------------------')
-            print(addsCount)
-            print('========================')
             if addsCount > 1000:
                 return -1
             else: