Commit 8d3dfa05a60ac943e823c9830379ff296a0e8e54

Authored by Aaron
1 parent e9c21d9a
Exists in master and in 1 other branch legacy

多图上传增加response格式化

Showing 1 changed file with 2 additions and 2 deletions   Show diff stats
packages/Image-upload/multiple.vue
@@ -134,6 +134,7 @@ export default { @@ -134,6 +134,7 @@ export default {
134 type: Boolean, 134 type: Boolean,
135 default: false 135 default: false
136 }, 136 },
  137 + responseFormat: Function,
137 limit: { 138 limit: {
138 type: Number, 139 type: Number,
139 default: 3 140 default: 3
@@ -177,8 +178,7 @@ export default { @@ -177,8 +178,7 @@ export default {
177 this.$emit('input', result.join(',')); 178 this.$emit('input', result.join(','));
178 }, 179 },
179 handleSuccess(response = {}, filename) { 180 handleSuccess(response = {}, filename) {
180 - const { result = [] } = response;  
181 - const url = result[0]; 181 + const url = this.responseFormat(response);
182 this.fileList.push({ url, name: filename }); 182 this.fileList.push({ url, name: filename });
183 this.rowFileNameList.push({ url, filename }); 183 this.rowFileNameList.push({ url, filename });
184 this.rowFileNameList = this.rowFileNameList.sort((a, b) => { 184 this.rowFileNameList = this.rowFileNameList.sort((a, b) => {