优化证书检测

dependabot/npm_and_yarn/fir_admin/ws-5.2.3
youngS 3 years ago
parent 86d5623437
commit 00032239b0
  1. 2
      fir_client/src/components/user/FirSuperSignBase.vue
  2. 2
      fir_ser/api/utils/app/iossignapi.py
  3. 12
      fir_ser/api/utils/app/supersignutils.py
  4. 2
      fir_ser/api/views/supersign.py

@ -158,7 +158,7 @@
width="100">
<template slot-scope="scope">
<el-popover trigger="hover" placement="top">
<p v-if="!scope.row.certid && scope.row.is_actived === true">开发证书不可用请在编辑中手动创建开发者证书</p>
<p v-if="!scope.row.certid && scope.row.is_actived === true">开发证书不可用请在编辑中导入或手动创建发布证书</p>
<p v-if="!scope.row.certid && scope.row.is_actived !== true">请先激活开发者账户</p>
<p v-if="scope.row.certid && scope.row.is_actived === true">账户已经启用</p>
<div slot="reference" class="name-wrapper">

@ -133,7 +133,7 @@ class AppDeveloperApiV2(object):
self.certid = certid
def active(self):
result = {}
result = {'data': []}
try:
apple_obj = AppStoreConnectApi(self.issuer_id, self.private_key_id, self.p8key)
certificates = apple_obj.get_all_certificates()

@ -693,10 +693,18 @@ class IosUtils(object):
app_api_obj = get_api_obj(auth)
status, result = app_api_obj.active()
if status:
cert_is_exists = True
for cert_obj in result.get('data', []):
if cert_obj.id == developer_obj.certid:
developer_obj.cert_expire_time = format_apple_date(cert_obj.expirationDate)
cert_is_exists = False
break
if developer_obj.certid and len(developer_obj.certid) > 3 and cert_is_exists and len(
result.get('data', [])) > 0:
# 数据库证书id和苹果开发id不一致,可认为被用户删掉,需要执行清理开发者操作
IosUtils.clean_developer(developer_obj, developer_obj.user_id)
developer_obj.certid = None
developer_obj.cert_expire_time = None
developer_obj.is_actived = True
else:
developer_obj.is_actived = False
@ -738,7 +746,8 @@ class IosUtils(object):
return status, result
@staticmethod
def check_developer_cert(developer_obj,user_obj):
def check_developer_cert(developer_obj, user_obj):
# 暂时无用
auth = get_auth_form_developer(developer_obj)
app_api_obj = get_api_obj(auth)
status, result = app_api_obj.get_cert_obj_by_cid(developer_obj.certid)
@ -747,7 +756,6 @@ class IosUtils(object):
certid=None, cert_expire_time=None)
return status, result
@staticmethod
def auto_get_certid_by_p12(developer_obj, user_obj):
auth = get_auth_form_developer(developer_obj)

@ -72,8 +72,6 @@ class DeveloperView(APIView):
if status:
if not developer_obj.certid:
IosUtils.get_device_from_developer(developer_obj, request.user)
else:
IosUtils.check_developer_cert(developer_obj, request.user)
return self.get(request)
else:
res.code = 1008

Loading…
Cancel
Save