diff --git a/im-platform/src/main/resources/application.yml b/im-platform/src/main/resources/application.yml index ab7dbd8..809dab3 100644 --- a/im-platform/src/main/resources/application.yml +++ b/im-platform/src/main/resources/application.yml @@ -14,6 +14,11 @@ spring: port: 6379 database: 1 + servlet: + multipart: + max-file-size: 50MB + max-request-size: 50MB + mybatis-plus: configuration: # 是否开启自动驼峰命名规则(camel case)映射,即从经典数据库列名 A_COLUMN(下划线命名) 到经典 Java 属性名 aColumn(驼峰命名) 的类似映射 diff --git a/im-ui/src/components/chat/MessageItem.vue b/im-ui/src/components/chat/MessageItem.vue index b667b2a..ae01832 100644 --- a/im-ui/src/components/chat/MessageItem.vue +++ b/im-ui/src/components/chat/MessageItem.vue @@ -19,17 +19,16 @@
-
+
- {{data.name}} - + {{data.name}}
{{fileSize}}
- +
@@ -66,7 +65,7 @@ }, methods:{ handleSendFail(){ - this.$message.error("该文件已上传失败,目前不支持自动重新发送,建议手动重新发送") + this.$message.error("该文件已发送失败,目前不支持自动重新发送,建议手动重新发送") } }, computed:{ @@ -171,7 +170,7 @@ } .send-fail{ - color: red; + color: #e60c0c; font-size: 30px; cursor: pointer; margin: 0 20px; @@ -213,6 +212,13 @@ } } + .send-fail{ + color: #e60c0c; + font-size: 30px; + cursor: pointer; + margin: 0 20px; + } + } } } diff --git a/im-ui/src/components/common/FileUpload.vue b/im-ui/src/components/common/FileUpload.vue index bdd83ee..173a140 100644 --- a/im-ui/src/components/common/FileUpload.vue +++ b/im-ui/src/components/common/FileUpload.vue @@ -3,6 +3,7 @@ :accept="fileTypes==null?'':fileTypes.join(',')" :show-file-list="false" :on-success="handleSuccess" + :on-error="handleError" :before-upload="beforeUpload"> @@ -44,6 +45,9 @@ this.$emit("fail", res, file); } }, + handleError(err,file){ + this.$emit("fail", err, file); + }, beforeUpload(file) { // 校验文件类型 if(this.fileTypes && this.fileTypes.length > 0){ diff --git a/im-ui/src/view/Chat.vue b/im-ui/src/view/Chat.vue index aabbd17..dc9549f 100644 --- a/im-ui/src/view/Chat.vue +++ b/im-ui/src/view/Chat.vue @@ -190,7 +190,6 @@ content: JSON.stringify(data), loadStatus: "ok" } - console.log(info); this.$store.commit("handleFileUpload", info); }) },