From 0b67037249e592fbadd4d3ffadc6236277f4e3e7 Mon Sep 17 00:00:00 2001 From: polang Date: Fri, 29 Dec 2017 21:20:11 +0800 Subject: [PATCH] [FileUpload] transform response url @input --- src/app/exports/file-upload/file-upload.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/exports/file-upload/file-upload.ts b/src/app/exports/file-upload/file-upload.ts index 90299ac7..6c0a9552 100644 --- a/src/app/exports/file-upload/file-upload.ts +++ b/src/app/exports/file-upload/file-upload.ts @@ -210,7 +210,9 @@ export class FileUpload implements AfterViewInit, ControlValueAccessor { protected onFileUploadSuccess(fileItem, res): Observable { fileItem.uploadResponse = res; - fileItem.url = this.transformResponseUrl(res); + const responseUrl = this.transformResponseUrl(res) || ''; + const url = responseUrl.length ? responseUrl[0] : responseUrl; + fileItem.url = url || fileItem.url; this.fileUploadSuccess.emit(fileItem); this.selectFiles = this.selectFiles.filter(item => item !== fileItem); this.onUploadFileChange([...(this.uploadFiles || []), fileItem]);