Browse Source

Merge branch 'V202108' into fix-92

pull/248/head
lewis 3 years ago
parent
commit
83d1d2b6f0
2 changed files with 18 additions and 6 deletions
  1. +18
    -4
      web_src/js/components/MinioUploader.vue
  2. +0
    -2
      web_src/less/_base.less

+ 18
- 4
web_src/js/components/MinioUploader.vue View File

@@ -335,8 +335,19 @@ export default {


async function uploadMinio(url, e) { async function uploadMinio(url, e) {
const res = await axios.put(url, e.target.result); const res = await axios.put(url, e.target.result);
delete e.target.result
delete e.target.result
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', 'text/plain')
xhr.send(e.target.result);
var etagValue = xhr.getResponseHeader('etag');
//console.log(etagValue);
etags[currentChunk] = etagValue;
} }


async function updateChunk(currentChunk) { async function updateChunk(currentChunk) {
@@ -359,8 +370,10 @@ export default {
// 获取分片上传url // 获取分片上传url
await getUploadChunkUrl(currentChunk, partSize); await getUploadChunkUrl(currentChunk, partSize);
if (urls[currentChunk] != '') { if (urls[currentChunk] != '') {
// 上传到minio
await uploadMinio(urls[currentChunk], e);
// 上传到minio
//await uploadMinio(urls[currentChunk], e);
await uploadMinioNewMethod(urls[currentChunk], e);
if (etags[currentChunk] != '') { if (etags[currentChunk] != '') {
// 更新数据库:分片上传结果 // 更新数据库:分片上传结果
//await updateChunk(currentChunk); //await updateChunk(currentChunk);
@@ -372,8 +385,9 @@ export default {
} }
} }
} catch (error) { } catch (error) {
this.emitDropzoneFailed(file);
console.log(error); console.log(error);
//this.emitDropzoneFailed(file);
//console.log(error);
} }
} }




+ 0
- 2
web_src/less/_base.less View File

@@ -890,8 +890,6 @@ footer {


.ui.menu.new-menu { .ui.menu.new-menu {
justify-content: center !important; justify-content: center !important;
padding-top: 15px !important;
margin-top: -15px !important;
margin-bottom: 15px !important; margin-bottom: 15px !important;
background-color: #fafafa !important; background-color: #fafafa !important;
border-width: 1px !important; border-width: 1px !important;


Loading…
Cancel
Save