浏览代码

fix upload

scorpio 2 年之前
父节点
当前提交
4c2216d792
共有 2 个文件被更改,包括 13 次插入2 次删除
  1. 7 1
      src/views/home/component/current.vue
  2. 6 1
      src/views/home/component/files_list.vue

+ 7 - 1
src/views/home/component/current.vue

@@ -130,6 +130,7 @@ export default {
   },
   data() {
     return {
+      dispatchParams: null,
       authorizeShow: false,
       addShow: false,
       show: false,
@@ -162,6 +163,7 @@ export default {
     return { permissions, user }
   },
   created() {
+    this.dispatchParams = this.$route.query
     this.folderName = this.$route.query.folderName
     this.folderNumber = this.$route.query.folderNumber
     this.isAccess = this.$route.query.isAccess
@@ -215,7 +217,11 @@ export default {
       })
     },
     addFile() {
-      this.$api.project.fileAdd(this.fileList).then(res => {
+      let data = { files: this.fileList }
+      if (this.dispatchParams) {
+        data = Object.assign(data, this.dispatchParams)
+      }
+      this.$api.project.fileAdd(data).then(res => {
         if (res.code === 200) {
           this.show = false
           this.$emit('reFiles')

+ 6 - 1
src/views/home/component/files_list.vue

@@ -220,6 +220,7 @@ export default {
   },
   data() {
     return {
+      dispatchParams: null,
       show: false,
       applyShow: false,
       files: [],
@@ -355,7 +356,11 @@ export default {
       })
     },
     addFile() {
-      this.$api.project.fileAdd(this.fileList).then(res => {
+      let data = { files: this.fileList }
+      if (this.query) {
+        data = Object.assign(data, this.query)
+      }
+      this.$api.project.fileAdd(data).then(res => {
         if (res.code === 200) {
           this.show = false
           this.$emit('reFiles')