Browse Source

解决 BUG

allen 3 năm trước cách đây
mục cha
commit
8e0c668101
1 tập tin đã thay đổi với 12 bổ sung1 xóa
  1. 12 1
      src/views/ncs-broadcast/index.vue

+ 12 - 1
src/views/ncs-broadcast/index.vue

@@ -695,11 +695,22 @@ export default {
           /** 新增 */
           delete this.formmodel.id
           this.formmodel.part_id = this.$store.getters.partId
+          //判断 janus 是否连接状态
+          if (this.janus === null) {
+            this.connect(this.rtcServer)
+            this.$message.error('重新连接,请再次点击保存')
+            return
+          }
 
           API_Broadcast.add(this.formmodel).then(result => {
             console.log(result)
             if (result){
-              this.createStreaming(result.id, result.audio_port);
+              if (result.id) {
+                this.createStreaming(result.id, result.audio_port);
+              } else {
+                this.$message.error('保存失败')
+                return
+              }
             } else {
               this.$message.error(this.$t('action.fromError'))
               return