From dacc95761cf7090c628fc37a5d4f8bb825ccbbb0 Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期六, 16 五月 2026 15:41:45 +0800
Subject: [PATCH] 企业新闻和通知公告
---
src/components/filePreview/index.vue | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/src/components/filePreview/index.vue b/src/components/filePreview/index.vue
index 7221b25..d8720c3 100644
--- a/src/components/filePreview/index.vue
+++ b/src/components/filePreview/index.vue
@@ -78,9 +78,9 @@
transformData: (workbookData) => workbookData,
});
-// 璁$畻灞炴�� - 鍒ゆ柇鏂囦欢绫诲瀷
+// 璁$畻灞炴�� - 鍒ゆ柇鏂囦欢绫诲瀷锛堟敮鎸乁RL甯︽煡璇㈠弬鏁帮級
const isImage = computed(() => {
- const state = /\.(jpg|jpeg|png|gif)$/i.test(fileUrl.value);
+ const state = /\.(jpg|jpeg|png|gif)(\?.*)?$/i.test(fileUrl.value);
if (state) {
imgUrl.value = fileUrl.value.replaceAll('word', 'img');
}
@@ -88,23 +88,24 @@
});
const isPdf = computed(() => {
- return /\.pdf$/i.test(fileUrl.value);
+ console.log(fileUrl.value)
+ return /\.pdf(\?.*)?$/i.test(fileUrl.value);
});
const isDoc = computed(() => {
- return /\.(doc|docx)$/i.test(fileUrl.value);
+ return /\.(doc|docx)(\?.*)?$/i.test(fileUrl.value);
});
const isXls = computed(() => {
- const state = /\.(xls|xlsx)$/i.test(fileUrl.value);
+ const state = /\.(xls|xlsx)(\?.*)?$/i.test(fileUrl.value);
if (state) {
- options.value.xls = /\.(xls)$/i.test(fileUrl.value);
+ options.value.xls = /\.(xls)(\?.*)?$/i.test(fileUrl.value);
}
return state;
});
const isZipOrRar = computed(() => {
- return /\.(zip|rar)$/i.test(fileUrl.value);
+ return /\.(zip|rar)(\?.*)?$/i.test(fileUrl.value);
});
const isSupported = computed(() => {
@@ -163,7 +164,7 @@
};
const open = (url) => {
- fileUrl.value = javaApi + url;
+ fileUrl.value = url;
dialogVisible.value = true;
};
const handleClose = () => {
--
Gitblit v1.9.3