mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2025-12-18 00:45:54 +08:00
修改上传图片大小限制,最大1M
This commit is contained in:
@@ -16,16 +16,9 @@ let commonUrl = (process.env.NODE_ENV === 'development' ? config.api_dev.common
|
||||
|
||||
// 文件上传接口
|
||||
export const uploadFile = commonUrl+ "/common/upload/file";
|
||||
// 验证码渲染图片接口
|
||||
export const drawCodeImage = commonUrl + "/common/captcha/draw/";
|
||||
// 获取菜单
|
||||
export const getMenuList = managerUrl + "/permission/getMenuList";
|
||||
// Websocket
|
||||
export const ws = managerUrl + "/ws";
|
||||
|
||||
export const getMessageSendData = "";
|
||||
|
||||
|
||||
//获取所有city
|
||||
export const getAllCity = (params) => {
|
||||
return getRequest(commonUrl + '/common/region/allCity', params)
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
:on-error="handleError"
|
||||
:format="['jpg','jpeg','png','gif','bmp']"
|
||||
accept=".jpg, .jpeg, .png, .gif, .bmp"
|
||||
:max-size="maxSize*1024"
|
||||
:max-size="1024"
|
||||
:on-format-error="handleFormatError"
|
||||
:on-exceeded-size="handleMaxSize"
|
||||
:before-upload="beforeUpload"
|
||||
@@ -74,10 +74,6 @@ export default {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
maxSize: {
|
||||
type: Number,
|
||||
default: 5
|
||||
},
|
||||
maxlength: Number,
|
||||
icon: {
|
||||
type: String,
|
||||
@@ -116,7 +112,7 @@ export default {
|
||||
this.loading = false;
|
||||
this.$Notice.warning({
|
||||
title: "文件大小过大",
|
||||
desc: "所选文件‘ " + file.name + " ’大小过大, 不得超过 " + this.maxSize + "M."
|
||||
desc: "所选文件大小过大, 不得超过1M."
|
||||
});
|
||||
},
|
||||
// 上传前
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
:on-success="handleSuccess"
|
||||
:on-error="handleError"
|
||||
:format="['jpg','jpeg','png','gif']"
|
||||
:max-size="maxSize*1024"
|
||||
:max-size="1024"
|
||||
:on-format-error="handleFormatError"
|
||||
:on-exceeded-size="handleMaxSize"
|
||||
:before-upload="handleBeforeUpload"
|
||||
@@ -72,10 +72,6 @@ export default {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
maxSize: {
|
||||
type: Number,
|
||||
default: 5
|
||||
},
|
||||
limit: {
|
||||
type: Number,
|
||||
default: 10
|
||||
@@ -147,11 +143,7 @@ export default {
|
||||
this.$Notice.warning({
|
||||
title: "文件大小过大",
|
||||
desc:
|
||||
"所选文件‘ " +
|
||||
file.name +
|
||||
" ’大小过大, 不得超过 " +
|
||||
this.maxSize +
|
||||
"M."
|
||||
"所选文件大小过大,不能超过1M."
|
||||
});
|
||||
},
|
||||
// 上传之前钩子
|
||||
|
||||
@@ -58,12 +58,12 @@
|
||||
</template>
|
||||
</div>
|
||||
<Upload v-if="liveForm.coverImg.length ==0" ref="upload" :show-upload-list="false" :on-success="handleCoverImgSuccess" :default-file-list="defaultImgList" :format="['jpg','jpeg','png']"
|
||||
:on-format-error="handleFormatError" :max-size="2048" :on-exceeded-size="handleMaxSize" type="drag" :action="action" :headers="accessToken" style="display: inline-block;width:58px;">
|
||||
:on-format-error="handleFormatError" :max-size="1024" :on-exceeded-size="handleMaxSize" type="drag" :action="action" :headers="accessToken" style="display: inline-block;width:58px;">
|
||||
<div style="width: 58px;height:58px;line-height: 58px;">
|
||||
<Icon type="ios-camera" size="20"></Icon>
|
||||
</div>
|
||||
</Upload>
|
||||
<div class="tips"> 直播间背景图,图片规则:建议像素1080*1920,大小不超过2M</div>
|
||||
<div class="tips"> 直播间背景图,图片规则:建议像素1080*1920,大小不超过1M</div>
|
||||
</FormItem>
|
||||
|
||||
<!-- 直播间背景墙 -->
|
||||
@@ -79,7 +79,7 @@
|
||||
</template>
|
||||
</div>
|
||||
<Upload v-if="liveForm.shareImg.length ==0" ref="upload" :show-upload-list="false" :on-success="handleShareImgSuccess" :default-file-list="defaultImgList" :format="['jpg','jpeg','png']"
|
||||
:on-format-error="handleFormatError" :max-size="2048" :on-exceeded-size="handleMaxSize" type="drag" :action="action" :headers="accessToken" style="display: inline-block;width:58px;">
|
||||
:on-format-error="handleFormatError" :max-size="1024" :on-exceeded-size="handleMaxSize" type="drag" :action="action" :headers="accessToken" style="display: inline-block;width:58px;">
|
||||
<div style="width: 58px;height:58px;line-height: 58px;">
|
||||
<Icon type="ios-camera" size="20"></Icon>
|
||||
</div>
|
||||
@@ -191,6 +191,13 @@ export default {
|
||||
this.imageVisible = true;
|
||||
this.imageSrc = src;
|
||||
},
|
||||
// 上传文件超过大小限制
|
||||
handleMaxSize(file) {
|
||||
this.$Notice.warning({
|
||||
title: "文件大小过大",
|
||||
desc: "所选文件大小过大, 不得超过 1M.",
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取直播间详情
|
||||
*/
|
||||
|
||||
@@ -187,7 +187,7 @@
|
||||
:headers="accessToken"
|
||||
:on-success="handleSuccess"
|
||||
:on-error="handleError"
|
||||
:max-size="5120"
|
||||
:max-size="1024"
|
||||
:on-exceeded-size="handleMaxSize"
|
||||
multiple
|
||||
type="drag"
|
||||
@@ -694,7 +694,7 @@ export default {
|
||||
handleMaxSize(file) {
|
||||
this.$Notice.warning({
|
||||
title: "文件大小过大",
|
||||
desc: "所选文件‘ " + file.name + " ’大小过大, 不得超过 5M.",
|
||||
desc: "所选文件大小过大, 不得超过 1M.",
|
||||
});
|
||||
},
|
||||
// 上传成功回调
|
||||
|
||||
Reference in New Issue
Block a user