封禁应用无法下载

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) {
document.title = data.msg;
this.error_msg.body = data.msg;
}
}
}, params)

@ -41,7 +41,8 @@
</div>
<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>
</div>

@ -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');

@ -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()

@ -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 = "可用下载额度不足,请联系开发者"

Loading…
Cancel
Save