From 7f268bea057e788824bdf290275342d0980cbaeb Mon Sep 17 00:00:00 2001
From: wupengfei <834520024@qq.com>
Date: 星期二, 15 四月 2025 14:43:47 +0800
Subject: [PATCH] fix: bug

---
 src/utils/common/download.ts |   15 +++------------
 pnpm-lock.yaml               |   18 +++++++++---------
 2 files changed, 12 insertions(+), 21 deletions(-)

diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index df3211d..1122aa4 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -21,13 +21,13 @@
     version: 1.0.3(@bole-12333/chat-kit@1.0.1)(@tiptap/core@2.11.7)(@tiptap/extension-document@2.11.7)(@tiptap/extension-image@2.11.7)(@tiptap/extension-mention@2.11.7)(@tiptap/extension-paragraph@2.11.7)(@tiptap/extension-placeholder@2.11.7)(@tiptap/extension-text@2.11.7)(@tiptap/pm@2.11.7)(@tiptap/suggestion@2.11.7)(dayjs@1.11.13)(vue@3.5.11)
   '@bole-core/components':
     specifier: latest
-    version: 1.3.9(@bole-core/core@1.0.3)(@bole-core/sass-utils@0.0.1)(@element-plus/icons-vue@2.3.1)(@tanstack/vue-query@4.37.1)(@videojs-player/vue@1.0.0)(@vueuse/core@11.1.0)(@vueuse/shared@13.1.0)(dayjs@1.11.13)(element-plus@2.9.7)(lodash@4.17.21)(mitt@3.0.1)(senin-help@1.0.5)(senin-vue@1.0.4)(video.js@7.21.7)(vue-component-type-helpers@2.2.8)(vue@3.5.11)
+    version: 1.3.9(@bole-core/core@1.0.4)(@bole-core/sass-utils@0.0.1)(@element-plus/icons-vue@2.3.1)(@tanstack/vue-query@4.37.1)(@videojs-player/vue@1.0.0)(@vueuse/core@11.1.0)(@vueuse/shared@13.1.0)(dayjs@1.11.13)(element-plus@2.9.7)(lodash@4.17.21)(mitt@3.0.1)(senin-help@1.0.5)(senin-vue@1.0.4)(video.js@7.21.7)(vue-component-type-helpers@2.2.8)(vue@3.5.11)
   '@bole-core/core':
     specifier: latest
-    version: 1.0.3(@ywwlmm/openapi@0.0.4)(ali-oss@6.22.0)(axios@1.7.7)(dayjs@1.11.13)(element-plus@2.9.7)(file-saver@2.0.5)(jszip@3.10.1)(lodash@4.17.21)(senior-request@1.0.4)(vue-router@4.5.0)(vue@3.5.11)(xlsx-style@0.8.13)(xlsx@0.18.5)
+    version: 1.0.4(@ywwlmm/openapi@0.0.4)(ali-oss@6.22.0)(axios@1.7.7)(dayjs@1.11.13)(element-plus@2.9.7)(file-saver@2.0.5)(jszip@3.10.1)(lodash@4.17.21)(senior-request@1.0.4)(vue-router@4.5.0)(vue@3.5.11)(xlsx-style@0.8.13)(xlsx@0.18.5)
   '@bole-core/pretty-layout':
     specifier: latest
-    version: 1.2.0(@bole-core/core@1.0.3)(@bole-core/sass-utils@0.0.1)(@element-plus/icons-vue@2.3.1)(@vueuse/core@11.1.0)(element-plus@2.9.7)(fuse.js@6.6.2)(lottie-web@5.12.2)(path-browserify@1.0.1)(path-to-regexp@6.3.0)(pinia@2.3.1)(vue-router@4.5.0)(vue@3.5.11)
+    version: 1.2.0(@bole-core/core@1.0.4)(@bole-core/sass-utils@0.0.1)(@element-plus/icons-vue@2.3.1)(@vueuse/core@11.1.0)(element-plus@2.9.7)(fuse.js@6.6.2)(lottie-web@5.12.2)(path-browserify@1.0.1)(path-to-regexp@6.3.0)(pinia@2.3.1)(vue-router@4.5.0)(vue@3.5.11)
   '@bole-core/sass-utils':
     specifier: latest
     version: 0.0.1(element-plus@2.9.7)
@@ -1562,7 +1562,7 @@
       vue: 3.5.11(typescript@4.9.5)
     dev: false
 
-  /@bole-core/components@1.3.9(@bole-core/core@1.0.3)(@bole-core/sass-utils@0.0.1)(@element-plus/icons-vue@2.3.1)(@tanstack/vue-query@4.37.1)(@videojs-player/vue@1.0.0)(@vueuse/core@11.1.0)(@vueuse/shared@13.1.0)(dayjs@1.11.13)(element-plus@2.9.7)(lodash@4.17.21)(mitt@3.0.1)(senin-help@1.0.5)(senin-vue@1.0.4)(video.js@7.21.7)(vue-component-type-helpers@2.2.8)(vue@3.5.11):
+  /@bole-core/components@1.3.9(@bole-core/core@1.0.4)(@bole-core/sass-utils@0.0.1)(@element-plus/icons-vue@2.3.1)(@tanstack/vue-query@4.37.1)(@videojs-player/vue@1.0.0)(@vueuse/core@11.1.0)(@vueuse/shared@13.1.0)(dayjs@1.11.13)(element-plus@2.9.7)(lodash@4.17.21)(mitt@3.0.1)(senin-help@1.0.5)(senin-vue@1.0.4)(video.js@7.21.7)(vue-component-type-helpers@2.2.8)(vue@3.5.11):
     resolution: {integrity: sha512-9lCPb9fKp0fUnC6YzMaGxDXiqcgYLMg/TuLNFOuClW1uuggEQfNPQxwSdWS4C/SynXuLVPPRArQUy08AheVNRw==}
     peerDependencies:
       '@bole-core/core': '*'
@@ -1582,7 +1582,7 @@
       vue: 3.5.11
       vue-component-type-helpers: ^2.1.6
     dependencies:
-      '@bole-core/core': 1.0.3(@ywwlmm/openapi@0.0.4)(ali-oss@6.22.0)(axios@1.7.7)(dayjs@1.11.13)(element-plus@2.9.7)(file-saver@2.0.5)(jszip@3.10.1)(lodash@4.17.21)(senior-request@1.0.4)(vue-router@4.5.0)(vue@3.5.11)(xlsx-style@0.8.13)(xlsx@0.18.5)
+      '@bole-core/core': 1.0.4(@ywwlmm/openapi@0.0.4)(ali-oss@6.22.0)(axios@1.7.7)(dayjs@1.11.13)(element-plus@2.9.7)(file-saver@2.0.5)(jszip@3.10.1)(lodash@4.17.21)(senior-request@1.0.4)(vue-router@4.5.0)(vue@3.5.11)(xlsx-style@0.8.13)(xlsx@0.18.5)
       '@bole-core/sass-utils': 0.0.1(element-plus@2.9.7)
       '@element-plus/icons-vue': 2.3.1(vue@3.5.11)
       '@tanstack/vue-query': 4.37.1(vue@3.5.11)
@@ -1600,8 +1600,8 @@
       vue-component-type-helpers: 2.2.8
     dev: false
 
-  /@bole-core/core@1.0.3(@ywwlmm/openapi@0.0.4)(ali-oss@6.22.0)(axios@1.7.7)(dayjs@1.11.13)(element-plus@2.9.7)(file-saver@2.0.5)(jszip@3.10.1)(lodash@4.17.21)(senior-request@1.0.4)(vue-router@4.5.0)(vue@3.5.11)(xlsx-style@0.8.13)(xlsx@0.18.5):
-    resolution: {integrity: sha512-nqcu2gcKN2+raP8N0uhstWUPVYvQ8jbDpbki+cczy7WqYhrVDulV4b+u1J/tcnTCxDYG+uRMNLucCMUo6WWHrA==}
+  /@bole-core/core@1.0.4(@ywwlmm/openapi@0.0.4)(ali-oss@6.22.0)(axios@1.7.7)(dayjs@1.11.13)(element-plus@2.9.7)(file-saver@2.0.5)(jszip@3.10.1)(lodash@4.17.21)(senior-request@1.0.4)(vue-router@4.5.0)(vue@3.5.11)(xlsx-style@0.8.13)(xlsx@0.18.5):
+    resolution: {integrity: sha512-Wf9LVeX5/dqQWMIjxT093ic86jzrHmX8rYdktp2wV4mIyWA7jmhyLl3ofe5ue2yX0YCtBTr+MEeRYy84LqM35w==}
     peerDependencies:
       '@ywwlmm/openapi': '*'
       ali-oss: '*'
@@ -1632,7 +1632,7 @@
       xlsx-style: 0.8.13(patch_hash=6ixwdxwh5a3amidwu6vee22jpi)
     dev: false
 
-  /@bole-core/pretty-layout@1.2.0(@bole-core/core@1.0.3)(@bole-core/sass-utils@0.0.1)(@element-plus/icons-vue@2.3.1)(@vueuse/core@11.1.0)(element-plus@2.9.7)(fuse.js@6.6.2)(lottie-web@5.12.2)(path-browserify@1.0.1)(path-to-regexp@6.3.0)(pinia@2.3.1)(vue-router@4.5.0)(vue@3.5.11):
+  /@bole-core/pretty-layout@1.2.0(@bole-core/core@1.0.4)(@bole-core/sass-utils@0.0.1)(@element-plus/icons-vue@2.3.1)(@vueuse/core@11.1.0)(element-plus@2.9.7)(fuse.js@6.6.2)(lottie-web@5.12.2)(path-browserify@1.0.1)(path-to-regexp@6.3.0)(pinia@2.3.1)(vue-router@4.5.0)(vue@3.5.11):
     resolution: {integrity: sha512-LvneMdMfGj6dpFR7voQd2F+v02P4zYHGP3BAWKcrTj8BMeWXRt08Sz7qBrhq1F8lidjqi7TCttQbx2cEV1qBEA==}
     peerDependencies:
       '@bole-core/core': '*'
@@ -1648,7 +1648,7 @@
       vue: 3.5.11
       vue-router: '*'
     dependencies:
-      '@bole-core/core': 1.0.3(@ywwlmm/openapi@0.0.4)(ali-oss@6.22.0)(axios@1.7.7)(dayjs@1.11.13)(element-plus@2.9.7)(file-saver@2.0.5)(jszip@3.10.1)(lodash@4.17.21)(senior-request@1.0.4)(vue-router@4.5.0)(vue@3.5.11)(xlsx-style@0.8.13)(xlsx@0.18.5)
+      '@bole-core/core': 1.0.4(@ywwlmm/openapi@0.0.4)(ali-oss@6.22.0)(axios@1.7.7)(dayjs@1.11.13)(element-plus@2.9.7)(file-saver@2.0.5)(jszip@3.10.1)(lodash@4.17.21)(senior-request@1.0.4)(vue-router@4.5.0)(vue@3.5.11)(xlsx-style@0.8.13)(xlsx@0.18.5)
       '@bole-core/sass-utils': 0.0.1(element-plus@2.9.7)
       '@element-plus/icons-vue': 2.3.1(vue@3.5.11)
       '@vueuse/core': 11.1.0(vue@3.5.11)
diff --git a/src/utils/common/download.ts b/src/utils/common/download.ts
index e9bf8f1..961ea6c 100644
--- a/src/utils/common/download.ts
+++ b/src/utils/common/download.ts
@@ -1,5 +1,5 @@
 import { format } from '@/utils';
-import { BoleRegExp, FILEMIME } from '@bole-core/core';
+import { BoleRegExp, FILEMIME, downloadFileByUrl as _downloadFileByUrl } from '@bole-core/core';
 import { saveAs } from 'file-saver';
 import JSZip from 'jszip';
 
@@ -29,18 +29,9 @@
   }
 }
 
-export function downloadFileByUrl(fileUrl, fileName?: string) {
-  //const suffix = /\.([0-9a-z]+)(?:[\?#]|$)/i.exec(fileUrl)[1];
-  const suffix = /\.([0-9a-z]+)(?:[#]|$)/i.exec(fileUrl)[1];
-  let name = fileName ? fileName : fileUrl.replace(BoleRegExp.RegFileName, '$2');
-  name += `.${suffix}`;
-  saveAs(fileUrl, name);
+export function downloadFileByUrl(fileUrl: string, fileName?: string) {
+  _downloadFileByUrl(fileUrl, fileName);
   return;
-  // if (/pdf/gi.test(suffix)) {
-  //   handlePdfLink(fileUrl, name);
-  // } else {
-  //   handleFileDownload(fileUrl, name);
-  // }
 }
 export const handleFileSaver = (file, name) => {
   saveAs(file, name);

--
Gitblit v1.9.1