优化代码

pull/5/head
youngS 4 years ago
parent 5a85eb20d6
commit ef8c0c3472
  1. 7
      fir_client/src/components/FirSuperSignBase.vue
  2. 36
      fir_ser/api/utils/app/supersignutils.py

@ -690,6 +690,12 @@
}, params) }, params)
}, },
iosdevicesudidFun(action, data) { iosdevicesudidFun(action, data) {
const loading = this.$loading({
lock: true,
text: '执行中,请耐心等待...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
iosdevicesudid(data => { iosdevicesudid(data => {
if (data.code === 1000) { if (data.code === 1000) {
if (action !== "DELETE") { if (action !== "DELETE") {
@ -697,6 +703,7 @@
this.pagination.total = data.count; this.pagination.total = data.count;
} }
} }
loading.close()
}, { }, {
"methods": action, "data": data "methods": action, "data": data
}) })

@ -28,7 +28,7 @@ def resign_by_app_obj(app_obj, need_download_profile=True):
d_time = time.time() d_time = time.time()
if need_download_profile: if need_download_profile:
IosUtils.modify_capability(developer_obj, app_obj, developer_app_id) IosUtils.modify_capability(developer_obj, app_obj, developer_app_id)
download_flag, result = IosUtils.exec_download_profile(app_obj, developer_obj, 2) download_flag, result = IosUtils.exec_download_profile(app_obj, developer_obj, None, 2)
else: else:
download_flag = True download_flag = True
IosUtils.run_sign(user_obj, app_obj, developer_obj, download_flag, None, d_time, {}, True) IosUtils.run_sign(user_obj, app_obj, developer_obj, download_flag, None, d_time, {}, True)
@ -296,7 +296,7 @@ class IosUtils(object):
return provision_name + '.mobileprovision' return provision_name + '.mobileprovision'
@staticmethod @staticmethod
def exec_download_profile(app_obj, developer_obj, sign_try_attempts=3): def exec_download_profile(app_obj, developer_obj, udid_info, sign_try_attempts=3):
result = {} result = {}
developer_app_id = None developer_app_id = None
auth = get_auth_form_developer(developer_obj) auth = get_auth_form_developer(developer_obj)
@ -311,7 +311,7 @@ class IosUtils(object):
if developer_appid_obj: if developer_appid_obj:
developer_app_id = developer_appid_obj.aid developer_app_id = developer_appid_obj.aid
status, result = get_api_obj(auth).get_profile(app_obj, None, status, result = get_api_obj(auth).get_profile(app_obj, udid_info,
get_profile_full_path(developer_obj, app_obj), get_profile_full_path(developer_obj, app_obj),
auth, developer_app_id, [did[0] for did in device_id_list]) auth, developer_app_id, [did[0] for did in device_id_list])
@ -443,7 +443,7 @@ class IosUtils(object):
d_result['msg'] = msg d_result['msg'] = msg
return True, d_result return True, d_result
def sign(self, sign_try_attempts=3, resign=False): def sign(self, sign_try_attempts=3):
d_result = {'code': 0, 'msg': 'success'} d_result = {'code': 0, 'msg': 'success'}
state, used_num = check_app_sign_limit(self.app_obj) state, used_num = check_app_sign_limit(self.app_obj)
if not state: if not state:
@ -459,20 +459,18 @@ class IosUtils(object):
d_result['msg'] = msg d_result['msg'] = msg
logger.error(d_result) logger.error(d_result)
return False, d_result return False, d_result
if not resign: app_udid_obj = AppUDID.objects.filter(app_id=self.app_obj, udid=self.udid_info.get('udid')).first()
app_udid_obj = AppUDID.objects.filter(app_id=self.app_obj, udid=self.udid_info.get('udid')).first() if app_udid_obj and app_udid_obj.is_signed:
if app_udid_obj and app_udid_obj.is_signed: apptodev_obj = APPToDeveloper.objects.filter(app_id=self.app_obj).first()
apptodev_obj = APPToDeveloper.objects.filter(app_id=self.app_obj).first() if apptodev_obj:
if apptodev_obj: release_obj = AppReleaseInfo.objects.filter(app_id=self.app_obj, is_master=True).first()
release_obj = AppReleaseInfo.objects.filter(app_id=self.app_obj, is_master=True).first() if release_obj.release_id == apptodev_obj.release_file:
if release_obj.release_id == apptodev_obj.release_file: msg = "udid %s exists app_id %s" % (self.udid_info.get('udid'), self.app_obj)
msg = "udid %s exists app_id %s" % (self.udid_info.get('udid'), self.app_obj) d_result['msg'] = msg
d_result['msg'] = msg logger.info(d_result)
logger.info(d_result) return True, d_result
return True, d_result logger.info("udid %s not exists app_id %s ,need sign" % (self.udid_info.get('udid'), self.app_obj))
logger.info("udid %s not exists app_id %s ,need sign" % (self.udid_info.get('udid'), self.app_obj))
else:
logger.info("resign app_id %s ,need resign" % self.app_obj)
call_flag = True call_flag = True
download_flag = False download_flag = False
count = 1 count = 1
@ -483,7 +481,7 @@ class IosUtils(object):
"call_loop download_profile appid:%s developer:%s count:%s" % (self.app_obj, self.developer_obj, count)) "call_loop download_profile appid:%s developer:%s count:%s" % (self.app_obj, self.developer_obj, count))
if self.developer_obj: if self.developer_obj:
download_flag, result = IosUtils.exec_download_profile(self.app_obj, self.developer_obj, download_flag, result = IosUtils.exec_download_profile(self.app_obj, self.developer_obj,
sign_try_attempts) self.udid_info, sign_try_attempts)
if download_flag: if download_flag:
call_flag = False call_flag = False
else: else:

Loading…
Cancel
Save