update 动态消息详情

This commit is contained in:
赵霄
2023-09-26 15:19:20 +08:00
parent 38225f5d4e
commit c199be378a
5 changed files with 232 additions and 7 deletions
+3 -3
View File
@@ -66,8 +66,8 @@ const Base64 = require('js-base64').Base64
// 支持预览的文件类型
const CAN_PREVIEW_FILE_TYPE = ['pdf', 'image']
// 支持预览的文件后缀
const CAN_PREVIEW_FILE_SUFFIX = ['doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'txt', 'mp3', 'mp4', 'flv']
// 支持预览的文件后缀
const CAN_PREVIEW_FILE_SUFFIX = ['jpg', 'jpeg', 'png', 'raw', 'pdf']
const uidGenerator = () => {
return '-' + parseInt(Math.random() * 10000 + 1, 10)
}
@@ -401,7 +401,7 @@ export default {
}
const fileType = file.type
// 截取文件后缀名
const fileSuffix = file.name ? file.name.split('.')[file.name.split('.').length - 1] : ''
const fileSuffix = file.name ? file.name.split('.')[file.name.split('.').length - 1].toLowerCase() : ''
const canPreview = fileType ? CAN_PREVIEW_FILE_TYPE.some(tt => fileType.indexOf(tt) !== -1) : CAN_PREVIEW_FILE_SUFFIX.some(tt => fileSuffix === tt)
// 判断是否为可预览格式的文件
if (!canPreview) {