narro 6 years ago
parent
commit
b2310488ef
1 changed files with 8 additions and 1 deletions
  1. 8
    1
      src/components/Editor/index.js

+ 8
- 1
src/components/Editor/index.js View File

@@ -85,8 +85,15 @@ class Editor extends React.Component {
85 85
    */
86 86
   handleUpload({ uid, path }) {
87 87
     const { fileMap } = this.state;
88
+    let { fileList } = this.state;
88 89
     fileMap[uid] = path;
89
-    this.setState({ fileMap });
90
+    fileList = fileList.map(item => {
91
+      if (item.uid === uid) {
92
+        item.thumbUrl = OSS_LINK + path;
93
+      }
94
+      return item;
95
+    });
96
+    this.setState({ fileMap, fileList });
90 97
   }
91 98
 
92 99
   /**