chenjunkai 6 lat temu
rodzic
commit
059fef7114
1 zmienionych plików z 6 dodań i 4 usunięć
  1. 6 4
      Controller/OTAEquipment.py

+ 6 - 4
Controller/OTAEquipment.py

@@ -428,6 +428,8 @@ def showAllEquipmentVersion(userID, response):
     return response.json(0, res)
 
 
+from Ansjer.config import SERVER_TYPE
+
 # 检测ota更新包
 @csrf_exempt
 def getNewVerInterface(request):
@@ -462,10 +464,10 @@ def getNewVerInterface(request):
         # 创建url的token
         tko = UrlTokenObject()
         file_path = tko.generate(data={'Url': "ansjer/" + CommonService.RandomStr(6) + "/" + file_path})
-
-        url = 'http://www.zositech.xyz/dlotapack/' + file_path
-        # url = SERVER_DOMAIN + 'dlotapack/' + file_path
-        # url = SERVER_DOMAIN + 'OTA/downloadsPack/' + file_path + '?time=' + str(time.time())
+        if SERVER_TYPE == 'Ansjer.formal_settings':
+            url = SERVER_DOMAIN + 'dlotapack/' + file_path
+        else:
+            url = 'http://www.zositech.xyz/dlotapack/' + file_path
         return response.json(0, {
             'ver': ver,
             'url': url,