This commit is contained in:
2026-10-21 17:49:04 +08:00
parent 22e60248d2
commit 4f5cec1b94
20 changed files with 192 additions and 56 deletions
@@ -69,7 +69,13 @@ async function upload(slot: LoadingPhotoSlot, event: Event) {
try {
ensureScope(); pending.value = { slot, key: crypto.randomUUID() }; persist()
pending.value.photo = await uploadLoadingPhoto(number, slot, file, pending.value.key); ensureScope(); persist(); await bind()
} catch (cause) { if (active) error.value = getApiErrorDetails(cause, '装车照片上传或保存失败,请核对原请求') }
} catch (cause) {
if (active) {
error.value = getApiErrorDetails(cause, '装车照片上传或保存失败,请核对原请求')
// 文件校验明确拒绝时尚未创建上传意图,允许重新选择;未知结果仍保留原请求。
if (pending.value && !pending.value.photo && /^(?:A0|HTTP_)?400$/.test(String(error.value.code))) { pending.value = null; persist() }
}
}
finally { if (active) busy.value = false }
}
onMounted(() => {