修改上传图片大小限制,最大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

@@ -89,7 +89,7 @@
</template>
</div>
<Upload ref="upload" :show-upload-list="false" :on-format-error="handleFormatError" :action="uploadFileUrl" :headers="accessToken" :on-success="handleSuccessGoodsPicture"
:format="['jpg','jpeg','png']" :max-size="2048" :on-exceeded-size="handleMaxSize" :before-upload="handleBeforeUpload" multiple type="drag"
:format="['jpg','jpeg','png']" :max-size="1024" :on-exceeded-size="handleMaxSize" :before-upload="handleBeforeUpload" multiple type="drag"
style="display: inline-block;width:58px;">
<div style="width: 58px;height:58px;line-height: 58px;">
<Icon type="ios-camera" size="20"></Icon>
@@ -316,7 +316,7 @@ export default {
handleMaxSize(file) {
this.$Notice.warning({
title: "超过文件大小限制",
desc: "图片 " + file.name + " 不能超过2mb",
desc: "图片不能超过1mb",
});
},
// 获取详情