|
|
@@ -240,8 +240,12 @@ export default {
|
|
|
},
|
|
|
handleOn(file, fileList) {
|
|
|
// console.log(fileList)
|
|
|
- console.log(file.type)
|
|
|
- const isJPG = (file.type === 'image/jpeg' || file.type === 'image/JPEG' || file.type === 'image/png' || file.type === 'image/PNG' || file.type === 'image/cr2' || file.type === 'image/CR2');
|
|
|
+ console.log(file)
|
|
|
+ var position = file.name.split('.')
|
|
|
+ var lastName=position[position.length-1]
|
|
|
+
|
|
|
+ // const isJPG = (file.type === '' || file.type === 'image/jpeg' || file.type === 'image/JPEG' || file.type === 'image/png' || file.type === 'image/PNG' || file.type === 'image/cr2' || file.type === 'image/CR2');
|
|
|
+ const isJPG =(lastName==='jpeg'||lastName==='GPEG'||lastName==='jpg'||lastName==='JPG'||lastName==='png'||lastName==='PNG'||lastName==='cr2'||lastName==='CR2')
|
|
|
if (!isJPG) {
|
|
|
// this.$message.error('上传头像图片只能是 JPG 格式!');
|
|
|
}
|