fix(admin): keep all batch-uploaded images when saving packages
Serialize multi-file uploads and reload package list after save so imageUrls persist. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -53,7 +53,9 @@ export default function MultiOssUploadField({
|
||||
}
|
||||
|
||||
async function uploadFiles(files: File[]) {
|
||||
const picked = files.slice(0, remaining);
|
||||
const current = normalizeUrls(value);
|
||||
const room = Math.max(0, maxCount - current.length);
|
||||
const picked = files.slice(0, room);
|
||||
if (!picked.length) {
|
||||
showUploadError(`最多 ${maxCount} 张`);
|
||||
return;
|
||||
@@ -68,7 +70,7 @@ export default function MultiOssUploadField({
|
||||
appended.push(result.url);
|
||||
}
|
||||
if (appended.length) {
|
||||
onChange?.([...urls, ...appended]);
|
||||
onChange?.([...current, ...appended]);
|
||||
toastSuccess(`已上传 ${appended.length} 张`);
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user