修复已知问题

publicsignpoll
youngS 3 years ago
parent 5316ed83c1
commit d943b5527d
  1. 2
      fir_ser/api/views/apps.py
  2. 12
      fir_ser/api/views/download.py
  3. 11
      fir_ser/api/views/login.py

@ -181,7 +181,7 @@ class AppInfoView(APIView):
app_obj.supersign_limit_number = data.get("supersign_limit_number", app_obj.supersign_limit_number = data.get("supersign_limit_number",
app_obj.supersign_limit_number) app_obj.supersign_limit_number)
app_obj.isshow = data.get("isshow", app_obj.isshow) app_obj.isshow = data.get("isshow", app_obj.isshow)
update_fields = ["description", "short", "name", "password", "supersign_limit_number"] update_fields = ["description", "short", "name", "password", "supersign_limit_number", "isshow"]
if get_user_domain_name(request.user) or get_app_domain_name(app_obj): if get_user_domain_name(request.user) or get_app_domain_name(app_obj):
app_obj.wxeasytype = data.get("wxeasytype", app_obj.wxeasytype) app_obj.wxeasytype = data.get("wxeasytype", app_obj.wxeasytype)
else: else:

@ -156,12 +156,6 @@ class ShortDownloadView(APIView):
return Response(res.dict) return Response(res.dict)
domain_name = get_redirect_server_domain(request, user_obj, get_app_domain_name(app_obj)) domain_name = get_redirect_server_domain(request, user_obj, get_app_domain_name(app_obj))
origin_domain_name = get_origin_domain_name(request) origin_domain_name = get_origin_domain_name(request)
if domain_name.split('//')[-1].split('/')[0] != origin_domain_name:
res.code = 1000
res.domain_name = domain_name
res.redirect = True
res.data = format_get_uri(domain_name, short, {'release_id': release_id, 'udid': udid})
return Response(res.dict)
if user_obj and user_obj.role and user_obj.role == 3: if user_obj and user_obj.role and user_obj.role == 3:
... ...
@ -171,6 +165,12 @@ class ShortDownloadView(APIView):
res.code = 1004 res.code = 1004
res.msg = "访问域名不合法" res.msg = "访问域名不合法"
return Response(res.dict) return Response(res.dict)
if domain_name.split('//')[-1].split('/')[0] != origin_domain_name:
res.code = 1000
res.domain_name = domain_name
res.redirect = True
res.data = format_get_uri(domain_name, short, {'release_id': release_id, 'udid': udid})
return Response(res.dict)
if udid: if udid:
if not app_obj.issupersign: if not app_obj.issupersign:
res.code = 1002 res.code = 1002

@ -18,7 +18,7 @@ from api.utils.throttle import VisitRegister1Throttle, VisitRegister2Throttle, G
from api.utils.utils import get_captcha, valid_captcha, \ from api.utils.utils import get_captcha, valid_captcha, \
get_sender_sms_token, is_valid_sender_code, get_sender_email_token, get_random_username, \ get_sender_sms_token, is_valid_sender_code, get_sender_email_token, get_random_username, \
check_username_exists, set_user_token, clean_user_token_and_cache check_username_exists, set_user_token, clean_user_token_and_cache
from fir_ser.settings import REGISTER, LOGIN, CHANGER, REPORT, NEW_USER_GIVE_DOWNLOAD_TIMES from fir_ser.settings import LOGIN, CHANGER, REPORT, NEW_USER_GIVE_DOWNLOAD_TIMES, REGISTER
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@ -619,11 +619,12 @@ class AuthorizationView(APIView):
res.code = 1008 res.code = 1008
res.msg = "邀请码已失效" res.msg = "邀请码已失效"
return Response(res.dict) return Response(res.dict)
if ext and ext.get('report'): if ext and ext.get('report'):
REGISTER = REPORT p_data = REPORT
else:
p_data = REGISTER
if REGISTER.get("captcha"): if p_data.get("captcha"):
is_valid = valid_captcha(ext.get("captcha_key", None), ext.get("authcode", None), target) is_valid = valid_captcha(ext.get("captcha_key", None), ext.get("authcode", None), target)
if ext and is_valid: if ext and is_valid:
pass pass
@ -632,7 +633,7 @@ class AuthorizationView(APIView):
res.msg = "图片验证码有误" res.msg = "图片验证码有误"
return Response(res.dict) return Response(res.dict)
if REGISTER.get("geetest"): if p_data.get("geetest"):
geetest = request.data.get("geetest", None) geetest = request.data.get("geetest", None)
if geetest and second_validate(geetest).get("result", "") == "success": if geetest and second_validate(geetest).get("result", "") == "success":
pass pass

Loading…
Cancel
Save