【操盘手】 流量分发功能提交

This commit is contained in:
wong
2025-06-04 11:38:43 +08:00
parent 1f2a1dab00
commit 296464bff9
9 changed files with 199 additions and 86 deletions

View File

@@ -649,24 +649,24 @@ class WebSocketController extends BaseController
// 消息拼接 msgType(1:文本 3:图片 43:视频 47:动图表情包gif、其他表情包 49:小程序/其他:图文、文件)
// 当前type 为文本、图片、动图表情包的时候content为string, 其他情况为对象 {type: 'file/link/...', url: '', title: '', thunmbPath: '', desc: ''}
$result = [
"cmdType" => "CmdSendMessage",
"content" => $dataArray['content'],
"msgSubType" => 0,
"msgType" => $dataArray['msgType'],
"seq" => time(),
"wechatAccountId" => $dataArray['wechatAccountId'],
"wechatChatroomId" => 0,
"wechatFriendId" => $dataArray['wechatFriendId'],
];
$result = [
"cmdType" => "CmdSendMessage",
"content" => $dataArray['content'],
"msgSubType" => 0,
"msgType" => $dataArray['msgType'],
"seq" => time(),
"wechatAccountId" => $dataArray['wechatAccountId'],
"wechatChatroomId" => 0,
"wechatFriendId" => $dataArray['wechatFriendId'],
];
$result = json_encode($result);
$this->client->send($result);
$message = $this->client->receive();
$message = json_decode($message, 1);
//关闭WS链接
$this->client->close();
//Log::write('WS个人消息发送');
$result = json_encode($result);
$this->client->send($result);
$message = $this->client->receive();
$message = json_decode($message, 1);
//关闭WS链接
$this->client->close();
//Log::write('WS个人消息发送');
return $message;
}