Commit ae5dedf7 by Sixong.Zhu

u

parent 84b3fa3d
Showing with 9 additions and 6 deletions
...@@ -228,19 +228,22 @@ ...@@ -228,19 +228,22 @@
const file = items[i].getAsFile(); const file = items[i].getAsFile();
if (file) { if (file) {
if (file.size <= 0) { if (file.size <= 0) {
this.$emit("error", MESSAGE_FILE_EMPTY); return this.$emit("error", MESSAGE_FILE_EMPTY);
return;
} }
if (this.isImage(file)) { if (this.isImage(file)) {
if (file.size >= MAX_IMAGE_SIZE) { if (file.size >= MAX_IMAGE_SIZE) {
this.$emit("error", MESSAGE_IMAGE_TOO_LARGE); return this.$emit(
return; "error",
MESSAGE_IMAGE_TOO_LARGE
);
} }
html += this.buildImageHtml(file); html += this.buildImageHtml(file);
} else { } else {
if (file.size >= MAX_FILE_SIZE) { if (file.size >= MAX_FILE_SIZE) {
this.$emit("error", MESSAGE_FILE_TOO_LARGE); return this.$emit(
return; "error",
MESSAGE_FILE_TOO_LARGE
);
} }
html += this.buildFileHtml(file); html += this.buildFileHtml(file);
} }
......
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 sign in to comment