| @@ -350,6 +350,17 @@ export default { | |||||
| etags[currentChunk] = res.headers.etag; | 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) { | async function updateChunk(currentChunk) { | ||||
| await axios.post( | await axios.post( | ||||
| '/attachments/update_chunk', | '/attachments/update_chunk', | ||||
| @@ -372,7 +383,7 @@ export default { | |||||
| await getUploadChunkUrl(currentChunk, partSize); | await getUploadChunkUrl(currentChunk, partSize); | ||||
| if (urls[currentChunk] != '') { | if (urls[currentChunk] != '') { | ||||
| // 上传到minio | // 上传到minio | ||||
| await uploadMinio(urls[currentChunk], e); | |||||
| await uploadMinioNewMethod(urls[currentChunk], e); | |||||
| if (etags[currentChunk] != '') { | if (etags[currentChunk] != '') { | ||||
| // 更新数据库:分片上传结果 | // 更新数据库:分片上传结果 | ||||
| //await updateChunk(currentChunk); | //await updateChunk(currentChunk); | ||||