封禁应用无法下载

pull/18/head
youngS 4 years ago
parent a57143f732
commit 875445bc09
  1. 1
      fir_client/src/components/ShortDownload.vue
  2. 3
      fir_client/src/components/apps/FirAppInfosBase.vue
  3. 36
      fir_client/vue.config.js
  4. 2
      fir_ser/api/utils/serializer.py
  5. 5
      fir_ser/api/views/download.py

@ -551,6 +551,7 @@
} }
if (data.msg) { if (data.msg) {
document.title = data.msg; document.title = data.msg;
this.error_msg.body = data.msg;
} }
} }
}, params) }, params)

@ -41,7 +41,8 @@
</div> </div>
<div class="actions"> <div class="actions">
<el-button @click="appDownload" class="download" icon="el-icon-view"> <el-button v-if="appinfos.status!==1" type="danger">该应用被封禁,请联系管理员</el-button>
<el-button v-else @click="appDownload" class="download" icon="el-icon-view">
预览 预览
</el-button> </el-button>
</div> </div>

@ -96,8 +96,26 @@ module.exports = {
'@': resolve('src') '@': resolve('src')
} }
}, },
plugins:[compress],
}, },
chainWebpack: config => { 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') { if (page==='analyz') {
config config
@ -119,21 +137,9 @@ module.exports = {
}) })
} }
if(IS_PROD){ // 移除prefetch插件,避免加载多余的资源
config.plugins=[compress,new UglifyJsPlugin({ config.plugins.delete('prefetch');
uglifyOptions: {
output: {
comments: false, // 去掉注释
},
warnings: false,
compress: {
drop_console: true,
drop_debugger: true,
pure_funcs: ['console.log']//移除console
}
}
})]
}
// config.plugins.delete('preload'); // config.plugins.delete('preload');

@ -235,7 +235,7 @@ class AppsShortSerializer(serializers.ModelSerializer):
def get_has_combo(self, obj): def get_has_combo(self, obj):
if obj.has_combo: if obj.has_combo:
obj.has_combo.has_combo = None 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 return AppsShortSerializer(obj.has_combo, context=self.context).data
master_release = serializers.SerializerMethodField() master_release = serializers.SerializerMethodField()

@ -155,6 +155,11 @@ class ShortDownloadView(APIView):
res.msg = "该应用不存在" res.msg = "该应用不存在"
return Response(res.dict) 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): if not check_user_has_all_download_times(app_obj):
res.code = 1009 res.code = 1009
res.msg = "可用下载额度不足,请联系开发者" res.msg = "可用下载额度不足,请联系开发者"

Loading…
Cancel
Save