parent
bf7387a6ba
commit
550875da40
|
@ -501,7 +501,7 @@ export default {
|
||||||
beforeUpload(file) {
|
beforeUpload(file) {
|
||||||
const isJPG = file.type === 'image/jpeg' || file.type === 'image/jpg' || file.type === 'image/png'
|
const isJPG = file.type === 'image/jpeg' || file.type === 'image/jpg' || file.type === 'image/png'
|
||||||
if (!isJPG) {
|
if (!isJPG) {
|
||||||
this.$message.error('上传头像图片只能是 jpg/jpeg/png 格式!')
|
this.$message.error('上传图片只能是 jpg/jpeg/png 格式!')
|
||||||
}
|
}
|
||||||
// 文件上传前的校验逻辑
|
// 文件上传前的校验逻辑
|
||||||
const isLt2M = file.size / 1024 / 1024 < 2
|
const isLt2M = file.size / 1024 / 1024 < 2
|
||||||
|
|
Loading…
Reference in New Issue