[update] 文件类型判断,用toLowerCase()之后在进行判断
This commit is contained in:
@@ -413,7 +413,7 @@ export default {
|
||||
return
|
||||
}
|
||||
// pdf预览
|
||||
if (canPreview && FILE_TYPE_PDF.includes(fileSuffix)) {
|
||||
if (canPreview && FILE_TYPE_PDF.includes(fileSuffix.toLowerCase())) {
|
||||
const url = previewPdf(file.id)
|
||||
window.open(url)
|
||||
return
|
||||
|
||||
@@ -659,7 +659,7 @@ export default {
|
||||
for (let i = 0; i < idArray.length; i++) {
|
||||
const id = idArray[i]
|
||||
const name = nameArray[i]
|
||||
var suffix = name.substring(name.lastIndexOf('.') + 1)
|
||||
var suffix = name.substring(name.lastIndexOf('.') + 1).toLowerCase()
|
||||
if (suffix === 'pdf') {
|
||||
pdfFileList.push({ id, name, suffix })
|
||||
}
|
||||
|
||||
@@ -660,7 +660,7 @@ export default {
|
||||
for (let i = 0; i < idArray.length; i++) {
|
||||
const id = idArray[i]
|
||||
const name = nameArray[i]
|
||||
var suffix = name.substring(name.lastIndexOf('.') + 1)
|
||||
var suffix = name.substring(name.lastIndexOf('.') + 1).toLowerCase()
|
||||
if (suffix === 'pdf') {
|
||||
pdfFileList.push({ id, name, suffix })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user