我从我的 url 返回一个 JSON 响应,用于上传,但在代码中我无法得到它,你能建议我在哪里以及如何得到它吗?
onUploadOutput(output: UploadOutput): void {
if (output.type === 'allAddedToQueue') {
const event: UploadInput = {
type: 'uploadAll',
url: this.url,
method: 'POST',
data: {foo: 'bar'}
};
this.uploadInput.emit(event);
........
} else if (output.type === 'done') {
this.files.forEach(file => {
console.log('ciao'); //DIDN'T WORK
console.log(file.response); //DIDN'T WORK
this.uploadInput.emit(file.response);
});
}
this.files = this.files.filter(file => file.progress.status !== UploadStatus.Done);
}
}