修复获取默认存储的问题

super_signature
nineven 5 years ago
parent 9299e4af05
commit 96cd18e405
  1. 13
      fir_client/src/components/FirSuperSignBase.vue
  2. 6
      fir_ser/api/utils/storage/storage.py
  3. BIN
      fir_ser/sqlite-autoconf-3310100.tar.gz

@ -330,7 +330,7 @@
placeholder:"",
codeactiveVisible:false,
pagination:{"currentPage":1,"total":0,"pagesize":10},
developer_used_info:{},
developer_used_info:{"all_usable_number":0,"other_used_sum":0,"all_use_number":0},
percentage:0,
}
@ -481,12 +481,13 @@
if(data.code === 1000){
this.app_developer_lists = data.data;
this.pagination.total=data.count;
this.developer_used_info=data.use_num;
if(this.developer_used_info.all_usable_number ===0){
this.percentage=0
}else {
this.percentage=parseInt(this.developer_used_info.flyapp_used_sum*100/this.developer_used_info.all_usable_number);
if(data.use_num){
this.developer_used_info=data.use_num;
if(this.developer_used_info.all_usable_number !==0){
this.percentage=parseInt(this.developer_used_info.flyapp_used_sum*100/this.developer_used_info.all_usable_number);
}
}
if(this.dialogaddDeveloperVisible){
this.canceledit();
this.$message.success("操作成功");

@ -71,9 +71,9 @@ class Storage(object):
return self.get_default_storage(user)
def get_default_storage(self,user):
admin_storage = UserInfo.objects.filter(is_superuser=True).order_by('pk').first().storage
if admin_storage:
return self.get_storage(UserInfo)
admin_obj = UserInfo.objects.filter(is_superuser=True).order_by('pk').first()
if admin_obj and admin_obj.storage:
return self.get_storage(admin_obj)
else:
storage_lists = THIRD_PART_CONFIG.get('storage')
for storage in storage_lists:

Loading…
Cancel
Save