From 47405797a645882a95c21161613b822737902bc9 Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Fri, 11 Mar 2022 10:37:13 +0800 Subject: [PATCH] fix issue --- web_src/js/components/MinioUploader.vue | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/web_src/js/components/MinioUploader.vue b/web_src/js/components/MinioUploader.vue index 7daec7512..29c57cbee 100755 --- a/web_src/js/components/MinioUploader.vue +++ b/web_src/js/components/MinioUploader.vue @@ -374,16 +374,26 @@ export default { } - async function uploadMinioNewMethod(url,e){ - console.log(_this.uploadtype,url,e) + async function uploadMinioNewMethod(url,e){ + var xhr = new XMLHttpRequest(); - xhr.open('PUT', url, false); - xhr.setRequestHeader('Content-Type', 'text/plain') - xhr.send(e.target.result); + xhr.open('PUT', url, false); if(_this.uploadtype===0){ + xhr.setRequestHeader('Content-Type', 'text/plain') + xhr.send(e.target.result); + var etagValue = xhr.getResponseHeader('etag'); etags[currentChunk] = etagValue; } + else if(_this.uploadtype===1){ + xhr.setRequestHeader('Content-Type', '') + xhr.send(e.target.result); + var etagValue = xhr.getResponseHeader('ETag'); + //console.log(etagValue); + etags[currentChunk] = etagValue; + } + + }