DESKTOP-O04BTUJ\muzen 2 years ago
parent
commit
8676fdbeed
1 changed files with 8 additions and 4 deletions
  1. 8 4
      src/mixin/index.js

+ 8 - 4
src/mixin/index.js

@@ -135,10 +135,14 @@ const audioMixin = {
   methods: {
   methods: {
     // 通过平台获取对应的音频类型
     // 通过平台获取对应的音频类型
     getAudioType(e) {
     getAudioType(e) {
-      platform(e).then(res => {
-        if (res.code === 0) {
-          this.audioTypeOptions = res.data[0].audioType.split(',').map(i => this.audioOptions.find(j => j.value == i))
-        }
+      return new Promise((resolve, reject) => {
+        platform(e).then(res => {
+          if (res.code === 0) {
+            resolve(this.audioTypeOptions = res.data[0].audioType.split(',').map(i => this.audioOptions.find(j => j.value == i)))
+          }
+        })
+      }).catch(err => {
+        reject()
       })
       })
     }
     }
   }
   }