修复添加密码,导致下载源文件失败

super_signature
nineven 5 years ago
parent d7fb8480c5
commit 5161f04fae
  1. 3
      fir_client/src/components/FirAppInfostimeline.vue
  2. 8
      fir_ser/api/views/download.py
  3. 1
      fir_ser/api/views/login.py

@ -141,7 +141,8 @@
'token': app.download_token, 'token': app.download_token,
'short': this.currentapp.short, 'short': this.currentapp.short,
'release_id': app.release_id, 'release_id': app.release_id,
"isdownload": true "password": this.currentapp.password,
"isdownload": true,
}, },
'app_id': this.currentapp.app_id 'app_id': this.currentapp.app_id
}) })

@ -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

@ -70,6 +70,7 @@ class LoginView(APIView):
response.code = 1003 response.code = 1003
else: else:
response.code = 1006 response.code = 1006
logger.error("username:%s failed too try , locked" % (username,))
response.msg = "用户登录失败次数过多,已被锁定,请1小时之后再次尝试" response.msg = "用户登录失败次数过多,已被锁定,请1小时之后再次尝试"
else: else:
response.code = 1001 response.code = 1001

Loading…
Cancel
Save