Explorar o código

修改了 默认上传 500k 变成 5000k

于添 hai 6 meses
pai
achega
476edffc36

+ 7 - 3
src/views/courseAdd/components/courseProduction/coverUpload/index.vue

@@ -8,7 +8,7 @@
 				:disabled="isedit ? coverFileList.length > 0 && isedit : coverFileList.length > 0"
 				>选择图片</a-button
 			>
-			<span style="margin-left: 10px">仅支持上传jpg/png格式文件,单个文件不能超过500kb</span>
+			<span style="margin-left: 10px">仅支持上传jpg/png格式文件,单个文件不能超过{{props.sizeMax}}}kb</span>
 		</div>
 		<a-upload
 			ref="upload"
@@ -49,6 +49,10 @@
 			required: true,
 			default: null
 		},
+		sizeMax: {
+			type: Number,
+			default: 5000
+		},
 		imageUrl: {
 			type: String,
 			required: true,
@@ -96,9 +100,9 @@
 		}
 
 		// 验证文件大小(500KB限制)
-		const isLt500K = file.size / 1024 < 500
+		const isLt500K = file.size / 1024 < props.sizeMax
 		if (!isLt500K) {
-			message.error('文件大小不能超过500KB!')
+			message.error(`文件大小不能超过${props.sizeMax}KB!`)
 			return false
 		}
 

+ 2 - 2
src/views/myResources/coverUpload/index.vue

@@ -52,7 +52,7 @@
 		},
 		sizeMax: {
 			type: Number,
-			default: 500
+			default: 5000
 		},
 		imageUrl: {
 			type: String,
@@ -104,7 +104,7 @@
 		// 验证文件大小(500KB限制)
 		const isLt500K = file.size / 1024 < props.sizeMax
 		if (!isLt500K) {
-			message.error('文件大小不能超过500KB!')
+			message.error(`文件大小不能超过${props.sizeMax}KB!`)
 			coverFileList.value = []
 			return false
 		}