Commit dd77730f authored by yyh's avatar yyh

文件大小变量提取

parent b1dd6209
......@@ -44,6 +44,7 @@ import H5Cropper from 'vue-cropper-h5';
import { Getter } from 'vuex-class';
import { TemplateDataItem } from '@/const/interface';
import { Route } from 'vue-router';
const maxFileSize = 2* 1024 * 1024;
@Component({
components: {
[Button.name]: Button,
......@@ -86,7 +87,7 @@ export default class AddBanner extends Vue {
this.$toast("最多上传4张banner图");
return;
}
if (e.target.files[0].size > 2* 1024 * 1024) {
if (e.target.files[0].size > maxFileSize) {
this.$toast("文件大小限制2M");
return;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment