From de511bf90c00c31eedbfbc7a6c04ab0687e0a5b9 Mon Sep 17 00:00:00 2001 From: MMXX Date: Sun, 2 Jan 2022 19:37:34 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8A=B6=E6=80=81=E5=B1=95=E7=A4=BA=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fir_client/vue.config.js | 2 +- fir_ser/api/utils/app/iossignapi.py | 5 +++-- fir_ser/api/utils/crontab/ctasks.py | 5 +++-- fir_ser/api/views/supersign.py | 4 ++-- fir_ser/fir_ser/settings.py | 5 +++++ 5 files changed, 14 insertions(+), 7 deletions(-) diff --git a/fir_client/vue.config.js b/fir_client/vue.config.js index 98aaa64..094dce6 100644 --- a/fir_client/vue.config.js +++ b/fir_client/vue.config.js @@ -82,7 +82,7 @@ if (page) { } } -const version='1.4.1'; +const version='1.4.2'; const pro_base_env = { baseUrl: 'https://flyapps.cn', diff --git a/fir_ser/api/utils/app/iossignapi.py b/fir_ser/api/utils/app/iossignapi.py index 2e4cbf4..bc888d6 100644 --- a/fir_ser/api/utils/app/iossignapi.py +++ b/fir_ser/api/utils/app/iossignapi.py @@ -18,7 +18,7 @@ from api.utils.app.shellcmds import shell_command, use_user_pass from api.utils.apple.appleapiv3 import AppStoreConnectApi from common.base.baseutils import get_format_time, format_apple_date, make_app_uuid from common.cache.state import CleanErrorBundleIdSignDataState -from fir_ser.settings import SUPER_SIGN_ROOT +from fir_ser.settings import SUPER_SIGN_ROOT, DEVELOPER_WRITE_STATUS logger = logging.getLogger(__name__) @@ -237,7 +237,8 @@ class AppDeveloperApiV2(object): if attr.__name__ in ['active', 'get_device']: return attr(*args, **kwargs) else: - if AppIOSDeveloperInfo.objects.filter(pk=self.developer_pk, status__in=[1, 3, 4]).first(): + if AppIOSDeveloperInfo.objects.filter(pk=self.developer_pk, + status__in=DEVELOPER_WRITE_STATUS).first(): start_time = time.time() logger.info(f'{self.issuer_id} calling {attr.__name__} time:{start_time}') result = attr(*args, **kwargs) diff --git a/fir_ser/api/utils/crontab/ctasks.py b/fir_ser/api/utils/crontab/ctasks.py index 0c8ec33..c59d6b0 100644 --- a/fir_ser/api/utils/crontab/ctasks.py +++ b/fir_ser/api/utils/crontab/ctasks.py @@ -14,7 +14,8 @@ from api.models import Apps, UserInfo, AppIOSDeveloperInfo from api.utils.app.supersignutils import IosUtils from api.utils.storage.storage import Storage from api.utils.utils import send_ios_developer_active_status -from fir_ser.settings import CACHE_KEY_TEMPLATE, SYNC_CACHE_TO_DATABASE, SUPER_SIGN_ROOT, MSGTEMPLATE +from fir_ser.settings import CACHE_KEY_TEMPLATE, SYNC_CACHE_TO_DATABASE, SUPER_SIGN_ROOT, MSGTEMPLATE, \ + DEVELOPER_AUTO_CHECK_STATUS logger = logging.getLogger(__name__) @@ -65,7 +66,7 @@ def auto_delete_ios_mobile_tmp_file(): def auto_check_ios_developer_active(): - all_ios_developer = AppIOSDeveloperInfo.objects.filter(status__in=[1, 2]) + all_ios_developer = AppIOSDeveloperInfo.objects.filter(status__in=DEVELOPER_AUTO_CHECK_STATUS) error_issuer_id = {} for ios_developer in all_ios_developer: userinfo = ios_developer.user_id diff --git a/fir_ser/api/views/supersign.py b/fir_ser/api/views/supersign.py index 15fdf30..cf4d94e 100644 --- a/fir_ser/api/views/supersign.py +++ b/fir_ser/api/views/supersign.py @@ -25,7 +25,7 @@ from api.utils.storage.caches import get_app_download_url from api.utils.utils import get_developer_devices from common.base.baseutils import get_choices_dict, get_choices_name_from_key from common.cache.state import CleanSignDataState -from fir_ser.settings import DEVELOPER_USE_STATUS +from fir_ser.settings import DEVELOPER_USE_STATUS, DEVELOPER_DISABLED_STATUS logger = logging.getLogger(__name__) @@ -73,7 +73,7 @@ class DeveloperView(APIView): res.data = developer_serializer.data res.count = developer_obj.count() - res.status_choices = get_choices_dict(AppIOSDeveloperInfo.status_choices, [2, 4, 5]) + res.status_choices = get_choices_dict(AppIOSDeveloperInfo.status_choices, DEVELOPER_DISABLED_STATUS) res.apple_auth_list = get_choices_dict(AppIOSDeveloperInfo.auth_type_choices) return Response(res.dict) diff --git a/fir_ser/fir_ser/settings.py b/fir_ser/fir_ser/settings.py index 0c722b0..afe4072 100644 --- a/fir_ser/fir_ser/settings.py +++ b/fir_ser/fir_ser/settings.py @@ -249,7 +249,12 @@ USER_FREE_DOWNLOAD_TIMES = 5 AUTH_USER_FREE_DOWNLOAD_TIMES = 10 NEW_USER_GIVE_DOWNLOAD_TIMES = 100 AUTH_USER_GIVE_DOWNLOAD_TIMES = 200 + +# (-1, '疑似被封'), (0, '未激活'), (1, '已激活'), (2, '协议待同意'), (3, '维护中'), (4, '证书过期'), (5, '状态异常') DEVELOPER_USE_STATUS = [1, 2, 3, 4, 5] # 开发者可用状态,详情查看 model.AppIOSDeveloperInfo +DEVELOPER_AUTO_CHECK_STATUS = [1, 2] # 定时认证自动检测 +DEVELOPER_WRITE_STATUS = [1, 3, 4] # 开发者api写操作查询 +DEVELOPER_DISABLED_STATUS = [2, 4, 5] # 开发者不可 修改为状态 SYNC_CACHE_TO_DATABASE = { 'download_times': 10, # 下载次数同步时间