修改上传图片大小限制,最大1M

This commit is contained in:
mabo
2021-08-06 15:35:07 +08:00
parent 00a64c4d2a
commit 5cfbfdf67c
11 changed files with 30 additions and 56 deletions

View File

@@ -78,7 +78,7 @@
</vuedraggable>
<Upload ref="upload" :show-upload-list="false"
:on-success="handleSuccessGoodsPicture" :format="['jpg', 'jpeg', 'png']"
:on-format-error="handleFormatError" :on-exceeded-size="handleMaxSize"
:on-format-error="handleFormatError" :on-exceeded-size="handleMaxSize" :max-size="1024"
:before-upload="handleBeforeUploadGoodsPicture" multiple type="drag" :action="uploadFileUrl"
:headers="accessToken" style="margin-left:10px">
<div style="width: 148px; height: 148px; line-height: 148px">
@@ -183,7 +183,7 @@
</vuedraggable>
<Upload ref="uploadSku" :show-upload-list="false"
:on-success="handleSuccess" :format="['jpg', 'jpeg', 'png']"
:on-format-error="handleFormatError" :on-exceeded-size="handleMaxSize"
:on-format-error="handleFormatError" :on-exceeded-size="handleMaxSize" :max-size="1024"
:before-upload="handleBeforeUpload" multiple type="drag" :action="uploadFileUrl"
:headers="accessToken" style="display: inline-block; width: 58px">
<div>
@@ -609,7 +609,7 @@ export default {
handleMaxSize(file) {
this.$Notice.warning({
title: "超过文件大小限制",
desc: "图片 " + file.name + " 不能超过2mb"
desc: "图片大小不能超过1MB"
});
},
// 图片上传前钩子