容易忘记的小知识

1
2
3
4
const isLt2M = file.size / 1024 / 1024 < 2
if (!isLt2M) {
defer.reject('图片必须小于2MB!')
}