zhuliu 1 년 전
부모
커밋
52f801a2c4
2개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 2
      src/api/newApi/file.js
  2. 2 1
      src/utils/model/ImportProgress/index.vue

+ 1 - 2
src/api/newApi/file.js

@@ -1,5 +1,4 @@
 import axios from "@/utils/axios";
-import $constants from "@/utils/constants";
 // 新系统文件新接口
 export default {
   uploadFile(data){
@@ -15,7 +14,7 @@ export default {
   },
   //上传分片
   uploadChunks(data) {
-    return axios.post('/fileManager/chunks?_=' + new Date().getTime(), {...data,sourceId:$constants.sourceId})
+    return axios.post('/fileManager/chunks?_=' + new Date().getTime(), data)
   },
   /**
    * 合并分片

+ 2 - 1
src/utils/model/ImportProgress/index.vue

@@ -91,7 +91,7 @@ export default {
         let fileChunks = createFileChunk(this.form.file)
         // console.log(fileChunks)
         // return
-        fileChunks = [1,2,3,4,5]
+        // fileChunks = [1,2,3,4,5]
         this.len = fileChunks.length + 3
         
           getFileMD5(this.form.file, async (md5) => {
@@ -125,6 +125,7 @@ export default {
                 formData.append('file', fileChunks[i].file)
                 formData.append('md5', md5)
                 formData.append('index', i)
+                formData.append('sourceId', this.$constants.sourceId)
                 // setTimeout(()=>{
                 //     const status = `将分片上传至服务器(${i + 1}/${fileChunks.length})`
                 //     this.record(status)