1
0

2 کامیت‌ها 75440722fd ... 214f34fc26

نویسنده SHA1 پیام تاریخ
  dos 214f34fc26 虚拟开播 2 هفته پیش
  dos 89f36a8a70 虚拟开播 2 هفته پیش

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

@@ -315,7 +315,7 @@ public class AppUserController extends BaseController
     @ApiOperation(value = "开关播", notes = "开关播")
     public R<String> openLive(HttpServletResponse response, @RequestBody LiveLive liveLive)
     {
-        String url = sysConfigService.selectConfigByKey("sys_live_apiurl").concat("live/openCloseLive");
+        String url = sysConfigService.selectConfigByKey("sys_live_apiurl").concat("/api/live/httpOpenCloseLive");
         Map<String, String> map = new HashMap<>();
         map.put("roomId", String.valueOf(liveLive.getId()));
         map.put("liveType", "1");
@@ -323,10 +323,13 @@ public class AppUserController extends BaseController
         map.put("description", liveLive.getTitle());
 
         String res = HttpClientUtils.ajaxPost(url,map);
-        if(StringUtils.isBlank(res) || JSONObject.parseObject(res).getString("code") != "1"){
+        if(StringUtils.isBlank(res) || !JSONObject.parseObject(res).getString("code").equals("1")){
+            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);
     }
 
     /**

+ 2 - 2
game-ui/src/views/business/channel/index.vue

@@ -180,12 +180,12 @@
 <!--      <el-table-column label="渠道key" align="center" prop="channelKey" />-->
       <el-table-column label="充值手续费" align="center" prop="rate">
         <template slot-scope="scope">
-          {{scope.row.rate * 100 + "%"}}
+          {{(scope.row.rate * 100).toFixed(2) + "%"}}
         </template>
       </el-table-column>
       <el-table-column label="提现手续费" align="center" prop="withdrawRate">
         <template slot-scope="scope">
-          {{scope.row.withdrawRate * 100 + "%"}}
+          {{(scope.row.withdrawRate * 100).toFixed(2) + "%"}}
         </template>
       </el-table-column>
       <el-table-column label="是否开启" align="center" prop="status">

+ 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?"关播":"虚拟开播"+"成功");
+        }
+
       });
     },
     /** 删除按钮操作 */