浏览代码

数据调试

wolyshaw 2 年之前
父节点
当前提交
844bde61d4
共有 1 个文件被更改,包括 5 次插入6 次删除
  1. 5 6
      src/teacher/music/upload/index.tsx

+ 5 - 6
src/teacher/music/upload/index.tsx

@@ -175,17 +175,15 @@ export default defineComponent({
         this.audioType = res.data.mp3Type
 
         if (this.audioType === 'MP3') {
-          if (res.data.metronomeUrl) {
-            this.hasBeat = 1
-          }
-          this.mp3Url = this.hasBeat ? res.data.metronomeUrl : res.data.url
+          this.hasBeat = res.data.hasBeat || 0
+          this.mp3Url = res.data.metronomeUrl || res.data.url
         } else {
           this.midiUrl = res.data.midiUrl
         }
 
         this.backgroundMp3s = (res.data.background || []).map((item, index) => {
           if (index === 0) {
-            this.bgmp3Url = this.hasBeat ? item.metronomeUrl : item.audioFileUrl
+            this.bgmp3Url = item.metronomeUrl || item.audioFileUrl
           }
           return {
             url: this.hasBeat ? item.metronomeUrl : item.audioFileUrl,
@@ -194,7 +192,7 @@ export default defineComponent({
         })
         this.reason = res.data.reason
 
-        // console.log(res.data)
+        console.log(this.bgmp3Url)
       } catch (error) {
         console.log(error)
       }
@@ -206,6 +204,7 @@ export default defineComponent({
         audioType: this.audioType,
         sourceType: 'TEACHER',
         mp3Type,
+        hasBeat: this.hasBeat,
         url: this.hasBeat ? '' : this.mp3Url,
         metronomeUrl: this.hasBeat ? this.mp3Url : '',
         showFingering: Number(this.showFingering) || undefined,