Browse Source

fix[litemall-admin]: 对象存储页面图片上传成功以后,不能再次上传

Junling Bu 6 years ago
parent
commit
fe823c08fa
1 changed files with 3 additions and 1 deletions
  1. 3 1
      litemall-admin/src/views/sys/os.vue

+ 3 - 1
litemall-admin/src/views/sys/os.vue

@@ -41,7 +41,7 @@
 
     <!-- 添加对话框 -->
     <el-dialog :visible.sync="createDialogVisible" title="上传对象">
-      <el-upload :show-file-list="false" :limit="1" :http-request="handleUpload" action="#" list-type="picture">
+      <el-upload ref="upload" :show-file-list="false" :limit="1" :http-request="handleUpload" action="#" list-type="picture">
         <el-button size="small" type="primary">点击上传</el-button>
       </el-upload>
     </el-dialog>
@@ -124,6 +124,8 @@ export default {
       this.createDialogVisible = true
     },
     handleUpload(item) {
+      this.$refs.upload.clearFiles()
+
       const formData = new FormData()
       formData.append('file', item.file)
       createStorage(formData).then(response => {