Kaynağa Gözat

去掉预览时获取URL

natasha 4 gün önce
ebeveyn
işleme
87dea2d3bf

+ 3 - 5
src/views/book/courseware/create/components/base/common/SelectResource.vue

@@ -103,7 +103,7 @@ import PaginationPage from '@/components/PaginationPage.vue';
 import AudioLine from '@/views/personal_workbench/project/components/AudioLine.vue';
 
 import { PageQueryProjectResourceList } from '@/api/list';
-import { H5StartupFile, GetFileURLMap } from '@/api/app';
+import { H5StartupFile } from '@/api/app';
 
 const Base64 = require('js-base64').Base64;
 import { getConfig } from '@/utils/auth';
@@ -333,10 +333,8 @@ export default {
           });
         }
       } else {
-        GetFileURLMap({ file_id_list: [file.file_id] }).then(({ url_map }) => {
-          this.newpath = `${this.file_preview_url}onlinePreview?url=${Base64.encode(url_map[file.file_id])}`;
-          this.visible_flag = true;
-        });
+        this.newpath = `${this.file_preview_url}onlinePreview?url=${Base64.encode(file.file_url)}`;
+        this.visible_flag = true;
       }
     },
   },

+ 5 - 2
src/views/book/courseware/create/components/question/character/Character.vue

@@ -163,9 +163,12 @@ export default {
       GetStaticResources('tool-TextToVoiceFile', {
         text: con.replace(/<[^>]+>/g, ''),
       })
-        .then(({ status, file_id }) => {
+        .then(({ status, file_id, file_url }) => {
           if (status === 1) {
-            this.data.option_list[index].audio_file_id = file_id;
+            this.data.option_list[index].audio_file_id = {
+              file_url,
+              file_id,
+            };
           }
         })
         .catch(() => {});

+ 1 - 1
src/views/book/courseware/preview/components/character/CharacterPreview.vue

@@ -178,7 +178,7 @@
               <div class="words-left" :style="{}">
                 <AudioPlay
                   v-if="isEnable(data.property.is_enable_voice)"
-                  :file-id="item.audio_file_id"
+                  :file-id="item.audio_file_id ? item.audio_file_id.file_url : ''"
                   :theme-color="
                     data.unified_attrib && data.unified_attrib.topic_color ? data.unified_attrib.topic_color : ''
                   "

+ 7 - 3
src/views/book/courseware/preview/components/character_base/components/AudioPlay.vue

@@ -100,9 +100,13 @@ export default {
     fileId: {
       handler(val) {
         if (!val) return;
-        GetFileURLMap({ file_id_list: [val] }).then(({ url_map }) => {
-          this.url = url_map[val];
-        });
+        if (val.indexOf('http') > -1) {
+          this.url = val;
+        } else {
+          GetFileURLMap({ file_id_list: [val] }).then(({ url_map }) => {
+            this.url = url_map[val];
+          });
+        }
       },
       immediate: true,
     },

+ 4 - 3
src/views/book/courseware/preview/components/new_word/NewWordPreview.vue

@@ -937,9 +937,10 @@ export default {
       let Bookanswer = [];
       let option_list = [];
       if (this.data.audio_data.file_id) {
-        GetFileURLMap({ file_id_list: [this.data.audio_data.file_id] }).then(({ url_map }) => {
-          this.data.audio_data.url = url_map[this.data.audio_data.file_id];
-        });
+        this.data.audio_data.url = this.data.audio_data.temporary_url;
+        // GetFileURLMap({ file_id_list: [this.data.audio_data.file_id] }).then(({ url_map }) => {
+        //   this.data.audio_data.url = url_map[this.data.audio_data.file_id];
+        // });
       }
       this.data.new_word_list.forEach((item) => {
         if (item.number) {

+ 7 - 3
src/views/book/courseware/preview/components/new_word/components/AudioPlay.vue

@@ -38,9 +38,13 @@ export default {
     fileId: {
       handler(val) {
         if (!val) return;
-        GetFileURLMap({ file_id_list: [val] }).then(({ url_map }) => {
-          this.url = url_map[val];
-        });
+        if (val.indexOf('http') > -1) {
+          this.url = val;
+        } else {
+          GetFileURLMap({ file_id_list: [val] }).then(({ url_map }) => {
+            this.url = url_map[val];
+          });
+        }
       },
       immediate: true,
     },

+ 1 - 1
src/views/book/courseware/preview/components/pinyin_base/PinyinBasePreview.vue

@@ -11,7 +11,7 @@
         <div class="first-con">
           <AudioPlay
             v-if="data.audio_file_id && data.property.audio_position === 'front'"
-            :file-id="data.audio_file_id"
+            :file-id="data.file_list[0].file_url"
             :theme-color="data.unified_attrib && data.unified_attrib.topic_color ? data.unified_attrib.topic_color : ''"
           />
           <div

+ 3 - 5
src/views/personal_workbench/project/ProductionResourceManage.vue

@@ -228,7 +228,7 @@ import UploadFile from './components/UploadFile.vue';
 import AudioLine from './components/AudioLine.vue';
 const Base64 = require('js-base64').Base64;
 import { getConfig } from '@/utils/auth';
-import { H5StartupFile, GetFileURLMap } from '@/api/app';
+import { H5StartupFile } from '@/api/app';
 import { GetFileStoreInfo } from '@/api/app';
 
 import * as THREE from 'three';
@@ -680,10 +680,8 @@ export default {
         this.loadModel(file.file_id);
         this.initThree();
       } else {
-        GetFileURLMap({ file_id_list: [file.file_id] }).then(({ url_map }) => {
-          this.newpath = `${this.file_preview_url}onlinePreview?url=${Base64.encode(url_map[file.file_id])}`;
-          this.visible = true;
-        });
+        this.newpath = `${this.file_preview_url}onlinePreview?url=${Base64.encode(file.file_url)}`;
+        this.visible = true;
       }
     },
     initThree() {