narro 5 лет назад
Родитель
Сommit
b2310488ef
1 измененных файлов: 8 добавлений и 1 удалений
  1. 8
    1
      src/components/Editor/index.js

+ 8
- 1
src/components/Editor/index.js Просмотреть файл

@@ -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
   /**