Commit fab7e516 by 匡雅琴

图片限制调整

1 parent cee43ac5
......@@ -192,19 +192,19 @@ export default {
// 默认1MB
const limitSize = 10
const isLt = file.size / 1024 / 1024 < limitSize
// if (!isLt) {
// this.$message.error('上传图片大小不能超过' + limitSize + 'MB!')
// return true
// }
if (!isLt) {
this.$message.error('上传图片大小不能超过' + limitSize + 'MB!')
return true
}
reader.readAsDataURL(file)
reader.onload = e => {
var image = new Image()
image.src = e.target.result
image.onload = () => {
if (image.width > 1440 || image.height > 1080) {
this.$message.error('图片长宽不超过1440x1080')
return
}
// if (image.width > 1440 || image.height > 1080) {
// this.$message.error('图片长宽不超过1440x1080')
// return
// }
this.previewList = this.previewList.filter(item => {
return item.attType == ATT_TYPE.TEXT || item.attType == ATT_TYPE.IMAGE
})
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!