Browse Source

fix 1483

tags/v1.22.2.1
lewis 3 years ago
parent
commit
b67274839a
1 changed files with 12 additions and 1 deletions
  1. +12
    -1
      web_src/js/components/ObsUploader.vue

+ 12
- 1
web_src/js/components/ObsUploader.vue View File

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


Loading…
Cancel
Save