|
@@ -287,7 +287,7 @@ class Party extends Api
|
|
|
}
|
|
|
|
|
|
//声网三个token
|
|
|
- $partyInfo['shengwang_token'] = $this->shengwang_token($easemob_room_id,1);
|
|
|
+ $partyInfo['shengwang_token'] = $this->shengwang_token_private($easemob_room_id);
|
|
|
|
|
|
$this->success("获取成功!",$partyInfo);
|
|
|
}
|
|
@@ -348,8 +348,19 @@ class Party extends Api
|
|
|
return $easemob_room_id;
|
|
|
}
|
|
|
|
|
|
+ public function shengwang_token(){
|
|
|
+ $party_id = input('party_id'); // 派对ID
|
|
|
+ $partyInfo = \app\common\model\Party::where(["id"=>$party_id])->find();
|
|
|
+ if(!$partyInfo) {
|
|
|
+ $this->error(__('派对不存在!'));
|
|
|
+ }
|
|
|
+
|
|
|
+ $rs = $this->shengwang_token_private($partyInfo['easemob_room_id']);
|
|
|
+ $this->success(1,$rs);
|
|
|
+ }
|
|
|
+
|
|
|
//声网3个token
|
|
|
- public function shengwang_token($easemob_room_id,$return = 0){
|
|
|
+ private function shengwang_token_private($easemob_room_id){
|
|
|
|
|
|
$config = config('shengwang');
|
|
|
$appId = $config['app_id'];
|
|
@@ -378,11 +389,7 @@ class Party extends Api
|
|
|
];
|
|
|
//dump($result);
|
|
|
|
|
|
- if($return == 1){
|
|
|
- return $result;
|
|
|
- }else{
|
|
|
- $this->success(1,$result);
|
|
|
- }
|
|
|
+ return $result;
|
|
|
}
|
|
|
|
|
|
|
|
@@ -872,7 +879,7 @@ class Party extends Api
|
|
|
$lsetList["partyInfo"] = $partyInfo;
|
|
|
|
|
|
//声网三个token
|
|
|
- $lsetList['shengwang_token'] = $this->shengwang_token($partyInfo['easemob_room_id'],1);
|
|
|
+ $lsetList['shengwang_token'] = $this->shengwang_token_private($partyInfo['easemob_room_id']);
|
|
|
|
|
|
//[环信] 更新聊天室自定义属性 在线用户人数
|
|
|
$easemob = new Easemob();
|