From bd213e2c0b48bfc4ddb94f0d29f89195ce19698d Mon Sep 17 00:00:00 2001 From: nineven Date: Tue, 5 May 2020 12:40:46 +0800 Subject: [PATCH] fix some bugs --- fir_client/src/components/FirDownload.vue | 19 +++++++++++------ fir_download/src/components/FirDownload.vue | 23 +++++++++++++++------ fir_ser/api/utils/app/supersignutils.py | 3 +-- fir_ser/api/views/download.py | 2 +- 4 files changed, 32 insertions(+), 15 deletions(-) diff --git a/fir_client/src/components/FirDownload.vue b/fir_client/src/components/FirDownload.vue index 0a7d00e..f66cf4f 100644 --- a/fir_client/src/components/FirDownload.vue +++ b/fir_client/src/components/FirDownload.vue @@ -181,14 +181,19 @@ return } if(this.currentappinfo.type === 1){ - if(this.currentappinfo.issupersign && this.udid !== this.$route.query.udid){ - if(this.agent !== ''){ - this.downloadurl=res.data.download_url; - // this.downloadurl = download_url.replace('http://localhost/download',getplisturl()); + if(this.currentappinfo.issupersign){ + if(this.$route.query.udid && this.udid === this.$route.query.udid){ + if(this.agent !== ''){ + let download_url = res.data.download_url; + this.downloadurl="itms-services://?action=download-manifest&url="+encodeURIComponent(download_url); + } + }else { + if(this.agent !== ''){ + this.downloadurl = res.data.download_url; + } } }else { let download_url = res.data.download_url; - // download_url = download_url.replace('http://localhost/download',getplisturl()); this.downloadurl="itms-services://?action=download-manifest&url="+encodeURIComponent(download_url); } }else{ @@ -233,10 +238,12 @@ } if(this.$route.query.udid){ params["udid"]=this.$route.query.udid + }else { + params["udid"]="" } getShortAppinfo(data => { - this.udid = data.udid; if (data.code === 1000) { + this.udid = data.udid; if(!data.data.master_release.release_id){ this.$message({ message:"该 release 版本不存在,请检查", diff --git a/fir_download/src/components/FirDownload.vue b/fir_download/src/components/FirDownload.vue index 2edd98b..1c3951f 100644 --- a/fir_download/src/components/FirDownload.vue +++ b/fir_download/src/components/FirDownload.vue @@ -175,19 +175,24 @@ }, methods: { download() { if( this.currentappinfo.app_id) { - this.isdownload = true; getdownloadurl(res => { - if (res.code === 1000) { - + if(res.code === 1000){ if(res.data.download_url === ""){ window.location.href=this.full_url; return } if(this.currentappinfo.type === 1){ - if(this.currentappinfo.issupersign && this.udid !== this.$route.query.udid){ - if(this.agent !== ''){ - this.download_url = res.data.download_url; + if(this.currentappinfo.issupersign){ + if(this.$route.query.udid && this.udid === this.$route.query.udid){ + if(this.agent !== ''){ + let download_url = res.data.download_url; + this.downloadurl="itms-services://?action=download-manifest&url="+encodeURIComponent(download_url); + } + }else { + if(this.agent !== ''){ + this.downloadurl = res.data.download_url; + } } }else { let download_url = res.data.download_url; @@ -228,8 +233,14 @@ if(this.$route.query.release_id){ params["release_id"]=this.$route.query.release_id } + if(this.$route.query.udid){ + params["udid"]=this.$route.query.udid + }else { + params["udid"]="" + } getShortAppinfo(data => { if (data.code === 1000) { + this.udid = data.udid; if(!data.data.master_release.release_id){ // this.$message({ // message:"该 release 版本不存在,请检查", diff --git a/fir_ser/api/utils/app/supersignutils.py b/fir_ser/api/utils/app/supersignutils.py index 1ed422c..31a527a 100644 --- a/fir_ser/api/utils/app/supersignutils.py +++ b/fir_ser/api/utils/app/supersignutils.py @@ -30,8 +30,7 @@ def udid_bytes_to_dict(xml_stream): def make_udid_mobileconfig(udid_url, PayloadOrganization, PayloadUUID=uuid.uuid1(), PayloadDescription='本文件仅用来获取设备ID', PayloadDisplayName='查询设备UDID'): # - mobileconfig = ''' - + mobileconfig = ''' diff --git a/fir_ser/api/views/download.py b/fir_ser/api/views/download.py index cb00917..324070e 100644 --- a/fir_ser/api/views/download.py +++ b/fir_ser/api/views/download.py @@ -155,7 +155,7 @@ class InstallView(APIView): download_url = get_download_url_by_cache(app_obj,release_id + apptype,600,isdownload,udid=udid) res.data={"download_url":download_url} - if download_url != "" and udid is None: + if download_url != "" and (udid is None or udid == ""): set_app_download_by_cache(app_id) return Response(res.dict) else: