Browse Source

云教练 token改为动态的

黄琪勇 3 tháng trước cách đây
mục cha
commit
c7f13c4a09

+ 1 - 1
src/views/Editor/CanvasTool/index.vue

@@ -263,7 +263,7 @@ const cloudCoachVisible = ref(false)
 
 // 处理云教练创建
 function handleCloudCoach(id: string) {
-  const YJL_URL = `${YJL_URL_API}?v=${Date.now()}&modelType=practise&id=${id}&Authorization=${getToken()}&platform=pc&zoom=0.8&instrumentId=`
+  const YJL_URL = `${YJL_URL_API}?v=${Date.now()}&modelType=practise&id=${id}&platform=pc&zoom=0.8&instrumentId=`
   createCloudCoachElement(YJL_URL)
   cloudCoachVisible.value = false
 }

+ 2 - 1
src/views/components/element/cloudCoachElement/cloudCoachPlayer/cloudCoachPlayer.vue

@@ -11,12 +11,13 @@
       <div class="spinner"></div>
       <div class="text">云教练加载中...</div>
     </div>
-    <iframe class="musicIframe" frameborder="0" :src="url" @load="handleIframeLoad"></iframe>
+    <iframe class="musicIframe" frameborder="0" :src="url + `&Authorization=${getToken()}`" @load="handleIframeLoad"></iframe>
   </div>
 </template>
 
 <script setup lang="ts">
 import { ref } from "vue"
+import { getToken } from "@/libs/auth"
 
 const props = withDefaults(
   defineProps<{