Browse Source

虚拟开播

dos 2 tháng trước cách đây
mục cha
commit
214f34fc26

+ 3 - 1
game-business/src/main/java/com/game/business/controller/AppUserController.java

@@ -327,7 +327,9 @@ public class AppUserController extends BaseController
             log.info("失败===============》》".concat(res));
             return R.fail(liveLive.getIslive().intValue()==1?"关播":"虚拟开播"+"失败");
         }
-        return R.ok(liveLive.getIslive().intValue()==1?"关播":"虚拟开播"+"成功");
+        String sign = TencentCloudImUtil.genUserSig(String.valueOf(liveLive.getUserId()), null);
+        String liveUrl = "rtmp://intl-rtmp.rtc.qq.com/push/"+liveLive.getId()+"?sdkappid="+TencentCloudImUtil.getSdkAppId()+"&userid="+liveLive.getUserId()+"&usersig="+sign;
+        return R.ok(liveLive.getIslive().intValue()==1?"关播":"虚拟开播"+"成功",liveUrl);
     }
 
     /**

+ 18 - 3
game-ui/src/views/business/user/index.vue

@@ -998,9 +998,24 @@ export default {
       var that =this;
       this.liveLive["title"] = this.closeMsg;
       openLive(this.liveLive).then(response => {
-        this.$modal.msgSuccess(this.liveLive.islive==1?"关播":"虚拟开播"+"成功");
-        this.liveOpen = false;
-        this.getList();
+        that.liveOpen = false;
+        setTimeout(function (){
+          that.getList();
+        },4000);
+        if(this.liveLive.islive!=1){
+          that.$alert(response["msg"], '开播成功', {
+            confirmButtonText: '确定',
+            callback: action => {
+              this.$message({
+                type: 'info',
+                message: `action: ${ action }`
+              });
+            }
+          });
+        }else{
+          that.$modal.msgSuccess(this.liveLive.islive==1?"关播":"虚拟开播"+"成功");
+        }
+
       });
     },
     /** 删除按钮操作 */