解决单据附件图片文件名带点号导致展示的问题

This commit is contained in:
jishenghua
2024-05-18 08:23:36 +08:00
parent c0ad0ce52c
commit 21e4eb7364

View File

@@ -312,7 +312,7 @@
console.log(file) console.log(file)
}, },
handlePreview(file){ handlePreview(file){
let postfix = file.name.substring(file.name.indexOf('.')) let postfix = file.name.substring(file.name.lastIndexOf('.'))
if(postfix === '.gif' || postfix === '.jpg' || postfix === '.jpeg' || postfix === '.png' || if(postfix === '.gif' || postfix === '.jpg' || postfix === '.jpeg' || postfix === '.png' ||
postfix === '.GIF' || postfix === '.JPG' || postfix === '.JPEG' || postfix === '.PNG') { postfix === '.GIF' || postfix === '.JPG' || postfix === '.JPEG' || postfix === '.PNG') {
this.previewImage = file.url || file.thumbUrl; this.previewImage = file.url || file.thumbUrl;