From f27ca082eb0a839449dd50c49007b58e5ed6946f Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Thu, 19 Jun 2025 19:08:01 +0800
Subject: [PATCH] feat: 服务名修改

---
 src/components/MediaPanel.vue |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/components/MediaPanel.vue b/src/components/MediaPanel.vue
index 911fb2e..79e4794 100644
--- a/src/components/MediaPanel.vue
+++ b/src/components/MediaPanel.vue
@@ -34,7 +34,7 @@
         <a-button type="primary" @click="compress">压缩打包</a-button>
     </div>
 
-    <a-spin :spinning="loading" :delay="1000" tip="downloading" size="large">
+    <a-spin :spinning="loading" :delay="1000" tip="加载中" size="large">
         <div class="media-panel-wrapper">
             <a-table class="media-table" :columns="columns" :data-source="mediaData.data" row-key="fingerprint"
                      rowKey="file_id" :row-selection="rowSelection"
@@ -123,7 +123,8 @@
 const showVideo = ref(false)
 const videoPlayerId = ref('videoPlayerId')
 // 文件前缀
-const prefix = 'https://dev.jxpskj.com:8026/cloud-bucket'
+// const prefix = 'https://dev.jxpskj.com:8026/cloud-bucket'
+const prefix = window.globalApiConfig?.baseUrl?.mediaPanelPrefix || import.meta.env.VITE_MEDIAPANEL_API_URL
 // 搜索栏配置项
 const searchPanelOptions = reactive({
   size: 'large',
@@ -245,6 +246,7 @@
 }
 
 function viewFile (objectKey: string) {
+  console.log(objectKey)
   const ext = objectKey.split('.')[1]
   const fileType = getFileType(ext)
   let url = ''
@@ -365,7 +367,6 @@
     const promiseList = [] as any
     selectedRow.list.forEach(e => {
       const url = prefix + e.object_key
-
       const promise = getFile(url, e.file_name)
       promiseList.push(promise)
     })
@@ -443,9 +444,10 @@
 function downloadMedia (media: MediaFile) {
   loading.value = true
   const url = prefix + '/' + media.object_key
-  const data = new Blob([url])
-  downloadFile(data, media.file_name)
-  loading.value = false
+  getFile(url, media.file_name).then(res => {
+    downloadFile(res.data, res.name)
+    loading.value = false
+  })
 
   // downloadMediaFile(workspaceId, media.file_id).then(res => {
   //     if (!res) {

--
Gitblit v1.9.3