Procházet zdrojové kódy

修复IM首次发送文件出错问题

kuaifan před 5 roky
rodič
revize
f509b433ad

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
     "name": "wookteam",
-    "version": "1.5.1",
+    "version": "1.5.2",
     "description": "WookTeam是一款轻量级的开源在线团队协作工具,提供各类文档工具、在线思维导图、在线流程图、项目管理、任务分发、即时IM,知识库管理等工具。",
     "scripts": {
         "ide-helper": "php artisan ide-helper:generate",

+ 7 - 5
resources/assets/js/main/components/chat/Upload.vue

@@ -40,12 +40,12 @@ export default {
         }
     },
 
-    mounted() {
-
+    watch: {
+        target(val) {
+            this.$set(this.params, 'username', val);
+        }
     },
 
-    watch: {},
-
     methods: {
         handleProgress(event, file) {
             //上传时
@@ -108,7 +108,9 @@ export default {
 
         upload(file) {
             //手动传file
-            this.$refs.upload.upload(file);
+            if (this.handleBeforeUpload()) {
+                this.$refs.upload.upload(file);
+            }
         },
     }
 }

+ 8 - 3
resources/assets/js/main/components/project/task/files.vue

@@ -306,15 +306,17 @@
         },
 
         watch: {
-            projectid() {
+            projectid(val) {
                 if (this.loadYet) {
                     this.getLists(true);
                 }
+                this.$set(this.params, 'projectid', val);
             },
-            taskid() {
+            taskid(val) {
                 if (this.loadYet) {
                     this.getLists(true);
                 }
+                this.$set(this.params, 'taskid', val);
             },
             canload(val) {
                 if (val && !this.loadYet) {
@@ -559,7 +561,10 @@
             },
 
             upload(file) {
-                this.$refs.upload.upload(file);
+                //手动传file
+                if (this.handleBeforeUpload()) {
+                    this.$refs.upload.upload(file);
+                }
             },
         }
     }