优化代码

dependabot/npm_and_yarn/fir_admin/ws-5.2.3
youngS 3 years ago
parent 45d813cca3
commit aa33e5640b
  1. 7
      fir_ser/api/utils/app/iossignapi.py
  2. 7
      fir_ser/api/views/receiveudids.py

@ -50,6 +50,13 @@ class ResignApp(object):
@staticmethod @staticmethod
def sign_mobileconfig(mobilconfig_path, sign_mobilconfig_path, ssl_pem_path, ssl_key_path): def sign_mobileconfig(mobilconfig_path, sign_mobilconfig_path, ssl_pem_path, ssl_key_path):
'''
:param mobilconfig_path: 描述文件绝对路径
:param sign_mobilconfig_path: 签名之后的文件绝对路径
:param ssl_pem_path: pem证书的绝对路径
:param ssl_key_path: key证书的绝对路径
:return:
'''
cmd = "openssl smime -sign -in %s -out %s -signer %s " \ cmd = "openssl smime -sign -in %s -out %s -signer %s " \
"-inkey %s -certfile %s -outform der -nodetach " % ( "-inkey %s -certfile %s -outform der -nodetach " % (
mobilconfig_path, sign_mobilconfig_path, ssl_pem_path, ssl_key_path, ssl_pem_path) mobilconfig_path, sign_mobilconfig_path, ssl_pem_path, ssl_key_path, ssl_pem_path)

@ -29,7 +29,7 @@ class IosUDIDView(View):
format_udid_info = udid_bytes_to_dict(stream_f) format_udid_info = udid_bytes_to_dict(stream_f)
logger.info("short %s get new udid %s" % (short, format_udid_info)) logger.info("short %s get new udid %s" % (short, format_udid_info))
server_domain = get_redirect_server_domain(request) server_domain = get_redirect_server_domain(request)
if True: try:
app_info = Apps.objects.filter(short=short).first() app_info = Apps.objects.filter(short=short).first()
if app_info: if app_info:
server_domain = get_redirect_server_domain(request, app_info.user_id, get_app_domain_name(app_info)) server_domain = get_redirect_server_domain(request, app_info.user_id, get_app_domain_name(app_info))
@ -56,8 +56,9 @@ class IosUDIDView(View):
else: else:
return HttpResponsePermanentRedirect( return HttpResponsePermanentRedirect(
"%s/%s" % (server_domain, short)) "%s/%s" % (server_domain, short))
# except Exception as e: except Exception as e:
# logger.error("short %s receive udid Exception:%s" % (short, e)) msg = "&msg=系统内部错误"
logger.error("short %s receive udid Exception:%s" % (short, e))
return HttpResponsePermanentRedirect( return HttpResponsePermanentRedirect(
"%s/%s?udid=%s%s" % (server_domain, short, format_udid_info.get("udid"), msg)) "%s/%s?udid=%s%s" % (server_domain, short, format_udid_info.get("udid"), msg))

Loading…
Cancel
Save