修复已知问题,修正 专属账户,其他应用禁止使用

qrnn
youngS 3 years ago
parent a60a7d6011
commit f04c4411c7
  1. 3
      fir_client/src/components/FirBase.vue
  2. 2
      fir_client/src/components/FirFooter.vue
  3. 2
      fir_client/src/components/apps/FirAppInfossupersign.vue
  4. 3
      fir_client/src/components/base/AppleDeveloperBindApp.vue
  5. 12
      fir_client/src/components/user/FirSuperSignBase.vue
  6. 16
      fir_ser/api/utils/app/supersignutils.py
  7. 26
      fir_ser/api/utils/serializer.py
  8. 2
      fir_ser/api/utils/utils.py

@ -18,8 +18,7 @@
effect="dark"
type="error">
<div slot="title">
<span :underline="false"
class="domian-tip-bar">应用分发请绑定您自己的域名平台分发域名可能因不可违因素更换将导致您的应用无法访问</span>
<span class="domian-tip-bar">应用分发请绑定您自己的域名平台分发域名可能因不可违因素更换将导致您的应用无法访问</span>
<el-button size="medium" @click="bind_domain_type=1,bind_domain_sure=true">立即绑定</el-button>
</div>
</el-alert>

@ -18,7 +18,7 @@
</div>
<div>
<div :underline="false" style="width: 200px; margin: 0 auto; padding: 5px 0;">
<div style="width: 200px; margin: 0 auto; padding: 5px 0;">
<el-link :href="footer.ipcBeiAn.url" :underline="false" rel="nofollow noopener"
target="_blank">{{ footer.ipcBeiAn.text }}
</el-link>

@ -36,7 +36,7 @@
<el-form-item label="专属配置" label-width="200px">
<el-button :disabled="supersign_disable" @click="bindAppletoapp">配置专属苹果开发账户</el-button>
<el-link :underline="false" style="margin-left: 20px" @click="bindAppletoapp"> 拥有
{{ currentapp.private_developer_number }} 个专属苹果开发者
{{ currentapp.private_developer_number }} 个专属苹果开发者使用了 {{ currentapp.private_developer_used_number }} 个设备数
</el-link>
</el-form-item>
<el-form-item label="签名限额" label-width="200px">

@ -22,7 +22,7 @@
<el-tag v-if="option.app_private_number > 0">专属应用账户存在其他应用单独使用该开发者</el-tag>
<el-tag v-else type="info">公共应用账户所有应用公用此开发者</el-tag>
<p>开发者ID: {{ option.issuer_id }} </p>
<p>应用签名数: {{ option.app_used_number }} </p>
<p>应用签名数: {{ option.app_used_count }} </p>
<p>已分配专属应用数: {{ option.app_private_number }} </p>
<p>开发者账户已使用设备数: {{ option.developer_used_number }}</p>
<p>开发者账户可用设备数: {{ 100 - option.developer_used_number }}</p>
@ -37,6 +37,7 @@
label="分配数量" size="small"/>
<el-button size="small" style="margin-left: 10px" @click="saveNumber(option)">保存修改</el-button>
</p>
<p>该应用已经消耗 {{ option.app_used_number }} 个设备数</p>
<p>描述: {{ option.description }}</p>
<div slot="reference" class="name-wrapper">

@ -330,18 +330,18 @@
<el-table-column
align="center"
label="应用签名"
prop="app_used_number"
prop="app_used_count"
width="60">
<template slot-scope="scope">
<el-popover placement="top" trigger="hover">
<p>签名了 {{ scope.row.app_used_number }} 个应用</p>
<p>签名了 {{ scope.row.app_used_count }} 个应用</p>
<div slot="reference" class="name-wrapper">
<el-link v-if="scope.row.app_used_number > 0" :underline="false"
<el-link v-if="scope.row.app_used_count > 0" :underline="false"
@click="show_device_ubill(scope.row.issuer_id)">
<el-tag size="medium">{{ scope.row.app_used_number }}</el-tag>
<el-tag size="medium">{{ scope.row.app_used_count }}</el-tag>
</el-link>
<el-tag v-else size="medium">{{ scope.row.app_used_number }}</el-tag>
<el-tag v-else size="medium">{{ scope.row.app_used_count }}</el-tag>
</div>
</el-popover>
</template>
@ -355,7 +355,7 @@
<el-popover placement="top"
trigger="hover">
<p>专属开发者被分配给了 {{ scope.row.app_private_number }} 个应用</p>
<p>专属开发者一共分配了 {{ scope.row.app_private_usable_number }} 个设备名额</p>
<p>专属开发者一共分配了 {{ scope.row.private_usable_number }} 个设备名额</p>
<p>专属开发者已经被专属应用使用了 {{ scope.row.app_private_used_number }} 个设备名额</p>
<div slot="reference" class="name-wrapper">
<el-link v-if="scope.row.app_private_number > 0" :underline="false"

@ -314,19 +314,26 @@ def get_developer_user_by_app_udid(user_objs, udid, app_obj):
logger.info(f'udid:{udid} only and return')
return developer_obj, True
# 新设备查找策略
# 根据app查找开发者账户
exist_app_developer_pk_list = []
for developer_obj in AppIOSDeveloperInfo.objects.filter(
pk__in=developer_udid_obj_list.filter(developerid__apptodeveloper__app_id=app_obj)):
if get_developer_udided(developer_obj)[2] + get_developer_can_used_from_public_sign(
developer_obj.user_id) < developer_obj.usable_number:
logger.info(f'app_obj:{app_obj} only and return')
return developer_obj, False
exist_app_developer_pk_list.append(developer_obj.pk)
# return developer_obj, False
apple_to_app = AppleDeveloperToAppUse.objects.filter(app_id=app_obj).first()
apple_to_app = AppleDeveloperToAppUse.objects.filter(app_id=app_obj, developerid__is_actived=True,
developerid__certid__isnull=False).first()
can_used_developer_pk_list = get_new_developer_by_app_obj(user_objs, app_obj, apple_to_app)
if not can_used_developer_pk_list:
if not can_used_developer_pk_list and apple_to_app:
can_used_developer_pk_list = get_new_developer_by_app_obj(user_objs, app_obj)
if can_used_developer_pk_list and exist_app_developer_pk_list:
can_used_developer_pk_list = list(set(can_used_developer_pk_list) & set(exist_app_developer_pk_list))
# 查询开发者策略 按照最小注册设备数进行查找,这样可以分散,进而使应用趋向于一个开发者,为后期更新提供方便
if can_used_developer_pk_list:
developer_obj_dict = AppIOSDeveloperInfo.objects.filter(pk__in=can_used_developer_pk_list).values(
@ -344,7 +351,7 @@ def get_developer_obj_by_others(user_obj, udid, app_obj):
if result:
return result
receive_user_id_list = IosDeveloperPublicPoolBill.objects.filter(to_user_id=user_obj).values('user_id').distinct()
if receive_user_id_list:
result, is_exist = get_developer_user_by_app_udid(UserInfo.objects.filter(pk__in=receive_user_id_list), udid,
app_obj)
f_count = get_ios_developer_public_num(user_obj)
@ -714,6 +721,7 @@ class IosUtils(object):
logger.warning(
"call_loop download_profile appid:%s developer:%s count:%s" % (self.app_obj, self.developer_obj, count))
if self.developer_obj:
return 11111
# register_devices_prefix = f"check_or_register_devices_{self.developer_obj.issuer_id}_{self.udid}"
register_devices_prefix = f"check_or_register_devices_{self.developer_obj.issuer_id}"
add_new_bundles_prefix = f"check_or_add_new_bundles_{self.developer_obj.issuer_id}_{self.app_obj.app_id}"

@ -159,6 +159,12 @@ class AppsSerializer(serializers.ModelSerializer):
def get_private_developer_number(self, obj):
return models.AppleDeveloperToAppUse.objects.filter(app_id=obj).count()
private_developer_used_number = serializers.SerializerMethodField()
def get_private_developer_used_number(self, obj):
return models.DeveloperDevicesID.objects.filter(app_id=obj,
developerid__appledevelopertoappuse__app_id=obj).distinct().count()
domain_name = serializers.SerializerMethodField()
def get_domain_name(self, obj):
@ -456,12 +462,13 @@ class DeveloperSerializer(serializers.ModelSerializer):
developer_used_number = serializers.SerializerMethodField()
developer_used_other_number = serializers.SerializerMethodField()
use_number = serializers.SerializerMethodField()
app_used_number = serializers.SerializerMethodField()
app_used_count = serializers.SerializerMethodField()
is_disabled = serializers.SerializerMethodField()
app_private_number = serializers.SerializerMethodField()
app_private_used_number = serializers.SerializerMethodField()
app_usable_number = serializers.SerializerMethodField()
app_private_usable_number = serializers.SerializerMethodField()
app_used_number = serializers.SerializerMethodField()
private_usable_number = serializers.SerializerMethodField()
def get_app_usable_number(self, obj):
app_id = self.context.get('app_id')
@ -472,6 +479,13 @@ class DeveloperSerializer(serializers.ModelSerializer):
return apple_to_app_obj.usable_number
return 0
def get_app_used_number(self, obj):
app_id = self.context.get('app_id', '')
if app_id:
return models.DeveloperDevicesID.objects.filter(developerid=obj,
app_id__app_id=app_id).distinct().count()
return 0
def get_developer_used_number(self, obj):
return models.UDIDsyncDeveloper.objects.filter(developerid=obj).count()
@ -484,7 +498,7 @@ class DeveloperSerializer(serializers.ModelSerializer):
def get_app_private_number(self, obj):
return models.AppleDeveloperToAppUse.objects.filter(developerid=obj).count()
def get_app_private_usable_number(self, obj):
def get_private_usable_number(self, obj):
used_number = models.AppleDeveloperToAppUse.objects.filter(developerid=obj).values('usable_number').aggregate(
Sum('usable_number')).get('usable_number__sum')
if not used_number:
@ -492,12 +506,14 @@ class DeveloperSerializer(serializers.ModelSerializer):
return used_number
def get_app_private_used_number(self, obj):
return models.DeveloperDevicesID.objects.filter(developerid=obj, app_id__appledevelopertoappuse__developerid=obj).values('udid').distinct().count()
return models.DeveloperDevicesID.objects.filter(developerid=obj,
app_id__appledevelopertoappuse__developerid=obj).values(
'udid').distinct().count()
def get_use_number(self, obj):
return models.DeveloperDevicesID.objects.filter(developerid=obj).values('udid').distinct().count()
def get_app_used_number(self, obj):
def get_app_used_count(self, obj):
return models.DeveloperAppID.objects.filter(developerid=obj).count()

@ -61,7 +61,7 @@ def get_developer_devices(developer_obj_lists):
other_used_sum = 0
flyapp_used_sum = 0
max_total = 0
for dev_obj in developer_obj_lists:
for dev_obj in developer_obj_lists.filter(is_actived=True):
other_used, flyapp_used, _ = get_developer_udided(dev_obj)
other_used_sum += other_used
flyapp_used_sum += flyapp_used

Loading…
Cancel
Save