From 812f662169e44224f408938ea0e51818575f7a8e Mon Sep 17 00:00:00 2001 From: kiloking Date: Fri, 12 Jan 2024 20:42:16 +0800 Subject: [PATCH] Update ModelSelect.js --- src/Page/Camera/ModelSelect.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Page/Camera/ModelSelect.js b/src/Page/Camera/ModelSelect.js index 4bcaeb4..556b357 100644 --- a/src/Page/Camera/ModelSelect.js +++ b/src/Page/Camera/ModelSelect.js @@ -160,6 +160,7 @@ function ModelSelect() { img: '', finished: 0, })); + let counterIndex = 0 const uploadPromises = imageUrls.map((imageUrl,index) => { return new Promise(async (resolve, reject) => { try { @@ -182,13 +183,19 @@ function ModelSelect() { } const responseData = await response.json(); + console.log(responseData); + if (responseData.message) { setMsg('Error:please upload the image again.') reject(new Error('Image upload failed.')); return; } + if(responseData.id){ + counterIndex++ + setMsg(`Flow task ${counterIndex}/${imageUrls.length} uploaded`) + } // 上传成功,等待结果 await new Promise((innerResolve) => setTimeout(innerResolve, 300));