From 68c7de7374c19474b756ce48ab1f02a40809010e Mon Sep 17 00:00:00 2001 From: youngS Date: Tue, 16 Mar 2021 15:09:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=8B=B9=E6=9E=9C=E5=8C=85?= =?UTF-8?q?=20=E4=BC=81=E4=B8=9A=E7=AD=BE=E6=98=BE=E7=A4=BA=E4=BC=81?= =?UTF-8?q?=E4=B8=9A=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/FirAppInfosbaseinfo.vue | 2 +- .../src/components/FirAppInfosdevices.vue | 6 +++-- .../src/components/FirAppInfostimeline.vue | 1 + fir_client/src/components/FirApps.vue | 23 +++++++++++++++---- fir_client/src/main.js | 1 + fir_client/src/utils/index.js | 1 + fir_ser/api/models.py | 2 +- fir_ser/api/utils/app/apputils.py | 1 + fir_ser/api/utils/app/supersignutils.py | 4 ++-- fir_ser/api/utils/serializer.py | 12 +++------- fir_ser/api/views/uploads.py | 5 ++-- 11 files changed, 37 insertions(+), 21 deletions(-) diff --git a/fir_client/src/components/FirAppInfosbaseinfo.vue b/fir_client/src/components/FirAppInfosbaseinfo.vue index 247c0c6..e9214a8 100644 --- a/fir_client/src/components/FirAppInfosbaseinfo.vue +++ b/fir_client/src/components/FirAppInfosbaseinfo.vue @@ -25,7 +25,7 @@ - + diff --git a/fir_client/src/components/FirAppInfosdevices.vue b/fir_client/src/components/FirAppInfosdevices.vue index 7e18a6c..b2f9b4b 100644 --- a/fir_client/src/components/FirAppInfosdevices.vue +++ b/fir_client/src/components/FirAppInfosdevices.vue @@ -6,7 +6,7 @@ @click="$router.push({name:'FirSuperSignBase',params:{act:'useddevices'},query:{bundleid: currentapp.bundle_id}})"> 该应用已经开启超级签,请点击查看最新设备列表 - +

UDID列表及用户信息 - {{ udidlists.length }}个设备

  ·   {{app.release_type|getiOStype}} +   · {{app.distribution_name}}

{{app.changelog}}

diff --git a/fir_client/src/components/FirApps.vue b/fir_client/src/components/FirApps.vue index 1900c4e..27148e8 100644 --- a/fir_client/src/components/FirApps.vue +++ b/fir_client/src/components/FirApps.vue @@ -42,7 +42,12 @@ {{ analyseappinfo.version}} (Build {{ analyseappinfo.buildversion}}) {{ - analyseappinfo.release_type_id|getiOStype}} + analyseappinfo|getiOStype}} + - {{ analyseappinfo.udid.length + }} UDID + @@ -441,6 +446,16 @@ loadingobj: null } }, methods: { + showUDID(appinfo) { + let udidstr = ''; + for (let i = 0; i < appinfo.udid.length; i++) { + udidstr = udidstr + "

" + appinfo.udid[i] + "

" + } + this.$alert(udidstr, appinfo.appname + ' UDID', { + confirmButtonText: '确定', + dangerouslyUseHTMLString: true, + }); + }, updateappinfo(file) { this.uploadsuccess += 1; if (this.uploadsuccess === 2) { @@ -750,11 +765,11 @@ }, }, filters: { - getiOStype: function (type) { + getiOStype: function (appinfo) { let ftype = ''; - if (type === 1) { + if (appinfo.release_type_id === 1) { ftype = '内测版' - } else if (type === 2) { + } else if (appinfo.release_type_id === 2) { ftype = '企业版' } return ftype diff --git a/fir_client/src/main.js b/fir_client/src/main.js index 9b47125..eb8e8f8 100644 --- a/fir_client/src/main.js +++ b/fir_client/src/main.js @@ -150,6 +150,7 @@ Vue.prototype.$notify = Notification; Vue.prototype.$loading = Loading.service; Vue.prototype.$confirm = MessageBox.confirm; Vue.prototype.$prompt = MessageBox.prompt; +Vue.prototype.$alert = MessageBox.alert; // Vue.use(ElementUI); Vue.use(Vuex); diff --git a/fir_client/src/utils/index.js b/fir_client/src/utils/index.js index f241c9e..8cb081d 100644 --- a/fir_client/src/utils/index.js +++ b/fir_client/src/utils/index.js @@ -58,6 +58,7 @@ export function getappinfo(file, successcallback, errcallback) { analyseappinfo.release_type_id = 1; analyseappinfo.udid = result.mobileProvision.ProvisionedDevices; } else { + analyseappinfo.distribution_name = result.mobileProvision.Name + ": " + result.mobileProvision.TeamName; analyseappinfo.release_type = 'Inhouse'; analyseappinfo.release_type_id = 2; analyseappinfo.udid = []; diff --git a/fir_ser/api/models.py b/fir_ser/api/models.py index 3386a87..963e1e9 100644 --- a/fir_ser/api/models.py +++ b/fir_ser/api/models.py @@ -147,7 +147,7 @@ class AppReleaseInfo(models.Model): icon_url = models.CharField(max_length=128, blank=True, verbose_name="图标url") changelog = models.TextField('更新日志', blank=True, null=True, default=None, ) udid = models.TextField('ios内测版 udid', blank=True, null=True, default='', ) - + distribution_name = models.CharField(max_length=128, null=True, blank=True, default='', verbose_name="企业签名") created_time = models.DateTimeField(auto_now_add=True, verbose_name="创建时间") class Meta: diff --git a/fir_ser/api/utils/app/apputils.py b/fir_ser/api/utils/app/apputils.py index 2e77cdc..d42cf1c 100644 --- a/fir_ser/api/utils/app/apputils.py +++ b/fir_ser/api/utils/app/apputils.py @@ -161,6 +161,7 @@ def SaveAppInfos(app_file_name, user_obj, appinfo, bundle_id, app_img, short, si "is_master": True, "changelog": appinfo.get("changelog", ''), "udid": appinfo.get("udid", ''), + "distribution_name": appinfo.get("distribution_name", ''), } try: AppReleaseInfo.objects.create(**release_data) diff --git a/fir_ser/api/utils/app/supersignutils.py b/fir_ser/api/utils/app/supersignutils.py index 9b851e4..c7556a6 100644 --- a/fir_ser/api/utils/app/supersignutils.py +++ b/fir_ser/api/utils/app/supersignutils.py @@ -10,10 +10,10 @@ from api.utils.app.iossignapi import AppDeveloperApi, ResignApp, AppDeveloperApi from api.models import APPSuperSignUsedInfo, AppUDID, AppIOSDeveloperInfo, AppReleaseInfo, Apps, APPToDeveloper, \ UDIDsyncDeveloper, DeveloperAppID, DeveloperDevicesID from api.utils.app.randomstrings import make_app_uuid, make_from_user_uuid -from api.utils.serializer import get_developer_udided from api.utils.storage.caches import del_cache_response_by_short, send_msg_over_limit from api.utils.utils import file_format_path, delete_app_to_dev_and_file, delete_app_profile_file, \ - send_ios_developer_active_status, get_profile_full_path, delete_local_files, download_files_form_oss + send_ios_developer_active_status, get_profile_full_path, delete_local_files, download_files_form_oss, \ + get_developer_udided from api.utils.storage.storage import Storage from django.core.cache import cache diff --git a/fir_ser/api/utils/serializer.py b/fir_ser/api/utils/serializer.py index b59eab7..d4fcff5 100644 --- a/fir_ser/api/utils/serializer.py +++ b/fir_ser/api/utils/serializer.py @@ -2,6 +2,7 @@ from rest_framework import serializers from api import models from api.utils.app.apputils import bytes2human from api.utils.TokenManager import DownloadToken +from api.utils.app.supersignutils import get_redirect_server_domain from api.utils.storage.storage import Storage from api.utils.utils import get_developer_udided import os, json, logging @@ -42,14 +43,7 @@ class AppsSerializer(serializers.ModelSerializer): preview_url = serializers.SerializerMethodField() def get_preview_url(self, obj): - preview_url = '' - if obj.domain_name: - preview_url = obj.domain_name - elif obj.user_id.domain_name: - preview_url = obj.user_id.domain_name - if preview_url: - return "http://%s" % preview_url - return '' + return get_redirect_server_domain(None, obj.user_id, obj.domain_name) sign_type_choice = serializers.SerializerMethodField() @@ -172,7 +166,7 @@ class AppReleaseSerializer(serializers.ModelSerializer): fields = ["app_version", "icon_url", "build_version", "release_type", "minimum_os_version", "created_time", "binary_size", "release_id", "size", "type", "editing", "master_color", "changelog", - "is_master", 'download_token', 'binary_url', 'udid'] + "is_master", 'download_token', 'binary_url', 'udid', 'distribution_name'] download_token = serializers.SerializerMethodField() size = serializers.SerializerMethodField() diff --git a/fir_ser/api/views/uploads.py b/fir_ser/api/views/uploads.py index a502d46..1db607c 100644 --- a/fir_ser/api/views/uploads.py +++ b/fir_ser/api/views/uploads.py @@ -16,7 +16,7 @@ from api.utils.app.randomstrings import make_from_user_uuid from rest_framework.response import Response from fir_ser import settings from api.utils.TokenManager import DownloadToken -from api.utils.app.supersignutils import resign_by_app_obj +from api.utils.app.supersignutils import resign_by_app_obj, get_redirect_server_domain import os, json, logging logger = logging.getLogger(__file__) @@ -74,7 +74,7 @@ class AppAnalyseView(APIView): upload_file_tmp_name("set", png_key, request.user.id) upload_file_tmp_name("set", upload_key, request.user.id) res.data = {"app_uuid": app_uuid, "short": short, - "domain_name": settings.SERVER_DOMAIN.get("FILE_UPLOAD_DOMAIN", None), + "domain_name": get_redirect_server_domain(request, request.user, None), "upload_token": upload_token, "upload_key": upload_key, "png_token": png_token, @@ -102,6 +102,7 @@ class AppAnalyseView(APIView): "miniOSversion": data.get("miniosversion"), "changelog": data.get("changelog", ''), "udid": data.get("udid", ''), + "distribution_name": data.get("distribution_name", ''), } try: