refactor(upload): 添加 try-finally 块以确保 uploadLoading 状态正确更新

This commit is contained in:
rd
2025-09-23 10:18:29 +08:00
parent c65d0421c0
commit 467e3a88ee
2 changed files with 43 additions and 35 deletions

View File

@ -71,6 +71,7 @@ export default {
};
const onSubmit = async (action) => {
try {
uploadLoading.value = true;
const filteredWorks = map(works.value, (work) => omit(work, 'videoInfo'));
const { code, data } = await postWorksBatch({ works: filteredWorks });
@ -88,6 +89,9 @@ export default {
}
}
}
} finally {
uploadLoading.value = false;
}
};
// 本地存储同步

View File

@ -72,6 +72,7 @@ export default {
};
const onSubmit = async (action) => {
try {
uploadLoading.value = true;
const filteredWorks = map(works.value, (work) => omit(work, 'videoInfo'));
const { code, data } = await postWorksBatchWriter({ works: filteredWorks }, writerCode.value);
@ -98,6 +99,9 @@ export default {
}
}
}
} finally {
uploadLoading.value = false;
}
};
const onUpload = async (action) => {