|
|
|
@@ -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); |
|
|
|
|