瀏覽代碼

修改特定包使用中国服务器

chenjunkai 6 年之前
父節點
當前提交
0eb9bcc5ed
共有 2 個文件被更改,包括 9 次插入6 次删除
  1. 0 2
      Controller/EquipmentManager.py
  2. 9 4
      Controller/OTAEquipment.py

+ 0 - 2
Controller/EquipmentManager.py

@@ -568,7 +568,6 @@ def deleteInterface(request):
         return response.json(0)
 
 
-from var_dump import var_dump
 # 新查询设备字段
 def queryInterface(request):
     request.encoding = 'utf-8'
@@ -618,7 +617,6 @@ def queryInterface(request):
         uv_dict = {}
         for us in us_qs:
             uv_dict[us['uid']] = us['version']
-        var_dump(uv_dict)
         for p in dvls:
             p['vod'] = []
             for dm in ubqs:

+ 9 - 4
Controller/OTAEquipment.py

@@ -1,4 +1,3 @@
-
 from zlib import crc32
 from django.core import serializers
 from wsgiref.util import FileWrapper
@@ -430,6 +429,7 @@ def showAllEquipmentVersion(userID, response):
 
 from Ansjer.config import SERVER_TYPE
 
+
 # 检测ota更新包
 @csrf_exempt
 def getNewVerInterface(request):
@@ -467,7 +467,10 @@ def getNewVerInterface(request):
         if SERVER_TYPE == 'Ansjer.formal_settings':
             url = SERVER_DOMAIN + 'dlotapack/' + file_path
         else:
-            url = 'http://www.zositech.xyz/dlotapack/' + file_path
+            if code == '18E201200CA' or code == '18E201200CZ':
+                url = 'http://www.zositech.xyz/dlotapack/' + file_path
+            else:
+                url = SERVER_DOMAIN + 'dlotapack/' + file_path
         return response.json(0, {
             'ver': ver,
             'url': url,
@@ -573,6 +576,8 @@ def downloadOTAInterface(request, fullPath, *callback_args, **callback_kwargs):
             return res.json(907)
     else:
         return res.json(444, 'fullPath')
+
+
 # ota包下载
 @csrf_exempt
 def downloadOTAInterfaceV2(request, fullPath, *callback_args, **callback_kwargs):
@@ -581,11 +586,11 @@ def downloadOTAInterfaceV2(request, fullPath, *callback_args, **callback_kwargs)
     print(fullPath)
     # 解密url的token
     url_token = UrlTokenObject(fullPath)
-    if ( '' == url_token.Url):
+    if ('' == url_token.Url):
         print('过期了')
         return res.json(907)
     else:
-        print (url_token.Url)
+        print(url_token.Url)
         fp = url_token.Url
     fullPath = fp[14:]
     if fullPath: