From b67274839a4384b9f60efc172ec96d06df3e98a9 Mon Sep 17 00:00:00 2001 From: lewis <747342561@qq.com> Date: Wed, 9 Feb 2022 18:00:04 +0800 Subject: [PATCH] fix 1483 --- web_src/js/components/ObsUploader.vue | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/web_src/js/components/ObsUploader.vue b/web_src/js/components/ObsUploader.vue index 3b5bd3162..9da601b74 100755 --- a/web_src/js/components/ObsUploader.vue +++ b/web_src/js/components/ObsUploader.vue @@ -350,6 +350,17 @@ export default { etags[currentChunk] = res.headers.etag; } + async function uploadMinioNewMethod(url,e){ + var xhr = new XMLHttpRequest(); + xhr.open('PUT', url, false); + xhr.setRequestHeader('Content-Type', '') + xhr.send(e.target.result); + var etagValue = xhr.getResponseHeader('etag'); + //console.log(etagValue); + etags[currentChunk] = etagValue; + console.log(etagValue) + } + async function updateChunk(currentChunk) { await axios.post( '/attachments/update_chunk', @@ -372,7 +383,7 @@ export default { await getUploadChunkUrl(currentChunk, partSize); if (urls[currentChunk] != '') { // 上传到minio - await uploadMinio(urls[currentChunk], e); + await uploadMinioNewMethod(urls[currentChunk], e); if (etags[currentChunk] != '') { // 更新数据库:分片上传结果 //await updateChunk(currentChunk);