Pārlūkot izejas kodu

Merge branch 'iteration-tenant-album'

lex 1 gadu atpakaļ
vecāks
revīzija
b32e1d84c9
1 mainītis faili ar 21 papildinājumiem un 9 dzēšanām
  1. 21 9
      src/teacher/music/upload/index.tsx

+ 21 - 9
src/teacher/music/upload/index.tsx

@@ -312,7 +312,18 @@ export default defineComponent({
       }
     },
     async submit(vals: any) {
-      console.log(vals)
+      if (
+        this.audioType === 'MP3' &&
+        this.backgroundMp3s.length > 0 &&
+        !this.bgmp3Url
+      ) {
+        Toast('请上传原音文件')
+        return
+      }
+      if (!this.titleImg) {
+        Toast('请上传曲谱封面')
+        return
+      }
       this.submitLoading = true
       try {
         if (this.$route.params.id) {
@@ -327,15 +338,16 @@ export default defineComponent({
             data: this.createSubmitData()
           })
         }
+        setTimeout(() => {
+          Toast('上传成功')
+        }, 100)
+        setTimeout(() => {
+          postMessage({
+            api: 'back'
+          })
+          this.submitLoading = false
+        }, 800)
       } catch (error) {}
-
-      Toast('上传成功')
-      setTimeout(() => {
-        postMessage({
-          api: 'back'
-        })
-        this.submitLoading = false
-      }, 800)
       console.log(vals)
     },
     onFormatter(val: any) {