@@ -23,6 +23,9 @@ export class JigsawUpload extends AbstractJigsawComponent {
2323 super ( ) ;
2424 }
2525
26+ @Input ( )
27+ public targetUrl : string = '/rdk/service/common/upload' ;
28+
2629 @Input ( )
2730 public fileType : string ;
2831
@@ -63,7 +66,7 @@ export class JigsawUpload extends AbstractJigsawComponent {
6366 Array . from ( files ) . forEach ( ( file : File , index ) => {
6467 const fileInfo : UploadFileInfo = { name : file . name , state : 'pause' , url : '' , file : file } ;
6568 this . _$fileInfoList . push ( fileInfo ) ;
66- if ( index < 5 ) {
69+ if ( index < 5 ) {
6770 this . _sequenceUpload ( fileInfo ) ;
6871 }
6972 } ) ;
@@ -87,7 +90,7 @@ export class JigsawUpload extends AbstractJigsawComponent {
8790 const formData = new FormData ( ) ;
8891 formData . append ( 'file' , fileInfo . file ) ;
8992 formData . append ( "filename" , encodeURI ( fileInfo . file . name ) ) ;
90- this . _http . post ( '/rdk/service/common/upload' , formData , { responseType : 'text' } ) . subscribe ( res => {
93+ this . _http . post ( this . targetUrl , formData , { responseType : 'text' } ) . subscribe ( res => {
9194 fileInfo . state = 'success' ;
9295 fileInfo . url = res ;
9396 this . _afterCurFileUploaded ( fileInfo ) ;
@@ -100,9 +103,9 @@ export class JigsawUpload extends AbstractJigsawComponent {
100103 private _afterCurFileUploaded ( fileInfo : UploadFileInfo ) {
101104 this . process . emit ( fileInfo ) ;
102105 const waitingFile = this . _$fileInfoList . find ( f => f . state == 'pause' ) ;
103- if ( waitingFile ) {
106+ if ( waitingFile ) {
104107 this . _sequenceUpload ( waitingFile )
105- } else if ( this . _isAllFilesUploaded ( ) ) {
108+ } else if ( this . _isAllFilesUploaded ( ) ) {
106109 this . complete . emit ( this . _$fileInfoList ) ;
107110 }
108111 }
0 commit comments