xie.bx 3 лет назад
Родитель
Сommit
d60e95955d

+ 5 - 0
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(驼峰命名) 的类似映射

+ 12 - 6
im-ui/src/components/chat/MessageItem.vue

@@ -19,17 +19,16 @@
 					<span title="发送失败" v-show="loadFail" @click="handleSendFail" class="send-fail el-icon-warning"></span>
 				</div>
 				<div class="im-msg-file" v-if="msgInfo.type==2">
-					<div class="im-file-box">	
+					<div class="im-file-box" v-loading="loading">	
 						<div class="im-file-info">
-							<el-link  class="im-file-name" underline="true" target="_blank" type="primary" :href="data.url">{{data.name}}</el-link>
-							
+							<el-link  class="im-file-name" :underline="true" target="_blank" type="primary" :href="data.url">{{data.name}}</el-link>
 							<div class="im-file-size">{{fileSize}}</div>
 						</div>
 						<div class="im-file-icon">
 							<span type="primary" class="el-icon-document"></span>
 						</div>
 					</div>
-				
+					<span title="发送失败" v-show="loadFail" @click="handleSendFail" class="send-fail el-icon-warning"></span>
 				</div>
 			</div>
 		</div>
@@ -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;
+					}
+					
 				}
 			}
 		}

+ 4 - 0
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">
 		<slot></slot>
 	</el-upload>
@@ -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){

+ 0 - 1
im-ui/src/view/Chat.vue

@@ -190,7 +190,6 @@
 						content: JSON.stringify(data),
 						loadStatus: "ok"
 					}
-					console.log(info);
 					this.$store.commit("handleFileUpload", info);
 				})
 			},