|
|
@ -132,7 +132,8 @@ class ShortDownloadView(APIView): |
|
|
|
udid = time |
|
|
|
udid = time |
|
|
|
if not udid: |
|
|
|
if not udid: |
|
|
|
udid = "" |
|
|
|
udid = "" |
|
|
|
logging.info("make cache_response release_id:%s udid:%s" % (release_id, udid)) |
|
|
|
logging.info( |
|
|
|
|
|
|
|
"get or make cache_response short:%s release_id:%s udid:%s" % (kwargs.get("short", ''), release_id, udid)) |
|
|
|
return "_".join( |
|
|
|
return "_".join( |
|
|
|
[settings.CACHE_KEY_TEMPLATE.get("download_short_key"), kwargs.get("short", ''), release_id, udid]) |
|
|
|
[settings.CACHE_KEY_TEMPLATE.get("download_short_key"), kwargs.get("short", ''), release_id, udid]) |
|
|
|
|
|
|
|
|
|
|
@ -174,6 +175,11 @@ class InstallView(APIView): |
|
|
|
res.data = {"download_url": download_url} |
|
|
|
res.data = {"download_url": download_url} |
|
|
|
if download_url != "" and "mobileconifg" not in download_url: |
|
|
|
if download_url != "" and "mobileconifg" not in download_url: |
|
|
|
set_app_download_by_cache(app_id) |
|
|
|
set_app_download_by_cache(app_id) |
|
|
|
|
|
|
|
if request.META.get('HTTP_X_FORWARDED_FOR',None): |
|
|
|
|
|
|
|
ip = request.META['HTTP_X_FORWARDED_FOR'] |
|
|
|
|
|
|
|
else: |
|
|
|
|
|
|
|
ip = request.META['REMOTE_ADDR'] |
|
|
|
|
|
|
|
logger.info("remote ip %s short %s download_url %s app_obj %s" % (ip, short, download_url, app_obj)) |
|
|
|
return Response(res.dict) |
|
|
|
return Response(res.dict) |
|
|
|
else: |
|
|
|
else: |
|
|
|
res.code = 1004 |
|
|
|
res.code = 1004 |
|
|
|