Browse Source

数据调试

wolyshaw 2 years ago
parent
commit
844bde61d4
1 changed files with 5 additions and 6 deletions
  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
         this.audioType = res.data.mp3Type
 
 
         if (this.audioType === 'MP3') {
         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 {
         } else {
           this.midiUrl = res.data.midiUrl
           this.midiUrl = res.data.midiUrl
         }
         }
 
 
         this.backgroundMp3s = (res.data.background || []).map((item, index) => {
         this.backgroundMp3s = (res.data.background || []).map((item, index) => {
           if (index === 0) {
           if (index === 0) {
-            this.bgmp3Url = this.hasBeat ? item.metronomeUrl : item.audioFileUrl
+            this.bgmp3Url = item.metronomeUrl || item.audioFileUrl
           }
           }
           return {
           return {
             url: this.hasBeat ? item.metronomeUrl : item.audioFileUrl,
             url: this.hasBeat ? item.metronomeUrl : item.audioFileUrl,
@@ -194,7 +192,7 @@ export default defineComponent({
         })
         })
         this.reason = res.data.reason
         this.reason = res.data.reason
 
 
-        // console.log(res.data)
+        console.log(this.bgmp3Url)
       } catch (error) {
       } catch (error) {
         console.log(error)
         console.log(error)
       }
       }
@@ -206,6 +204,7 @@ export default defineComponent({
         audioType: this.audioType,
         audioType: this.audioType,
         sourceType: 'TEACHER',
         sourceType: 'TEACHER',
         mp3Type,
         mp3Type,
+        hasBeat: this.hasBeat,
         url: this.hasBeat ? '' : this.mp3Url,
         url: this.hasBeat ? '' : this.mp3Url,
         metronomeUrl: this.hasBeat ? this.mp3Url : '',
         metronomeUrl: this.hasBeat ? this.mp3Url : '',
         showFingering: Number(this.showFingering) || undefined,
         showFingering: Number(this.showFingering) || undefined,