From 875445bc09dcd575a817b7cdd736142f00e6a9a5 Mon Sep 17 00:00:00 2001 From: youngS Date: Mon, 10 May 2021 17:28:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=81=E7=A6=81=E5=BA=94=E7=94=A8=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fir_client/src/components/ShortDownload.vue | 1 + .../src/components/apps/FirAppInfosBase.vue | 3 +- fir_client/vue.config.js | 36 +++++++++++-------- fir_ser/api/utils/serializer.py | 2 +- fir_ser/api/views/download.py | 5 +++ 5 files changed, 30 insertions(+), 17 deletions(-) diff --git a/fir_client/src/components/ShortDownload.vue b/fir_client/src/components/ShortDownload.vue index c3c18b7..daa2775 100644 --- a/fir_client/src/components/ShortDownload.vue +++ b/fir_client/src/components/ShortDownload.vue @@ -551,6 +551,7 @@ } if (data.msg) { document.title = data.msg; + this.error_msg.body = data.msg; } } }, params) diff --git a/fir_client/src/components/apps/FirAppInfosBase.vue b/fir_client/src/components/apps/FirAppInfosBase.vue index 661cc8e..e26acc8 100644 --- a/fir_client/src/components/apps/FirAppInfosBase.vue +++ b/fir_client/src/components/apps/FirAppInfosBase.vue @@ -41,7 +41,8 @@
- + 该应用被封禁,请联系管理员 + 预览
diff --git a/fir_client/vue.config.js b/fir_client/vue.config.js index 94b8a81..dd656ff 100644 --- a/fir_client/vue.config.js +++ b/fir_client/vue.config.js @@ -96,8 +96,26 @@ module.exports = { '@': resolve('src') } }, + plugins:[compress], }, chainWebpack: config => { + if(IS_PROD){ + config.optimization.minimizer=[ + new UglifyJsPlugin({ + uglifyOptions: { + output: { + comments: false, // 去掉注释 + }, + warnings: false, + compress: { + drop_console: true, + drop_debugger: true, + pure_funcs: ['console.log']//移除console + } + } + }) + ] + } if (page==='analyz') { config @@ -119,21 +137,9 @@ module.exports = { }) } - if(IS_PROD){ - config.plugins=[compress,new UglifyJsPlugin({ - uglifyOptions: { - output: { - comments: false, // 去掉注释 - }, - warnings: false, - compress: { - drop_console: true, - drop_debugger: true, - pure_funcs: ['console.log']//移除console - } - } - })] - } + // 移除prefetch插件,避免加载多余的资源 + config.plugins.delete('prefetch'); + // config.plugins.delete('preload'); diff --git a/fir_ser/api/utils/serializer.py b/fir_ser/api/utils/serializer.py index 3ab438b..65324c6 100644 --- a/fir_ser/api/utils/serializer.py +++ b/fir_ser/api/utils/serializer.py @@ -235,7 +235,7 @@ class AppsShortSerializer(serializers.ModelSerializer): def get_has_combo(self, obj): if obj.has_combo: obj.has_combo.has_combo = None - if obj.has_combo.isshow: + if obj.has_combo.isshow and obj.has_combo.status == 1: return AppsShortSerializer(obj.has_combo, context=self.context).data master_release = serializers.SerializerMethodField() diff --git a/fir_ser/api/views/download.py b/fir_ser/api/views/download.py index 7e0ec60..67d84ce 100644 --- a/fir_ser/api/views/download.py +++ b/fir_ser/api/views/download.py @@ -155,6 +155,11 @@ class ShortDownloadView(APIView): res.msg = "该应用不存在" return Response(res.dict) + if app_obj.status != 1: + res.code = 1004 + res.msg = "该应用被封禁,无法下载安装" + return Response(res.dict) + if not check_user_has_all_download_times(app_obj): res.code = 1009 res.msg = "可用下载额度不足,请联系开发者"