1.优化ws参数格式auth-token和user-token
This commit is contained in:
@@ -71,16 +71,20 @@ class Live extends Backend
|
||||
$adminId = $this->auth ? (int) ($this->auth->id ?? 0) : 0;
|
||||
$adminWs = GameWebSocketAuthHelper::issueAdminWsToken($adminId);
|
||||
$baseWsUrl = WebSocketConfigHelper::wsUrl($request);
|
||||
$wsUrl = WebSocketConfigHelper::appendTokensToWsUrl($baseWsUrl, [
|
||||
'admin_ws_token' => (string) ($adminWs['token'] ?? ''),
|
||||
]);
|
||||
$wsUrl = GameWebSocketAuthHelper::buildAdminConnectUrl(
|
||||
$baseWsUrl,
|
||||
(string) ($adminWs['token'] ?? '')
|
||||
);
|
||||
|
||||
return $this->success('', [
|
||||
'name' => 'ws.admin.live',
|
||||
'ws_url' => $wsUrl,
|
||||
'ws_base_url' => $baseWsUrl,
|
||||
'admin_ws_token' => (string) ($adminWs['token'] ?? ''),
|
||||
'admin-ws-token' => (string) ($adminWs['token'] ?? ''),
|
||||
'admin_ws_token_ttl' => (int) ($adminWs['ttl'] ?? 0),
|
||||
'ws_query_params' => [
|
||||
GameWebSocketAuthHelper::QUERY_ADMIN_WS_TOKEN,
|
||||
],
|
||||
'connect_tip' => 'The admin live page auto-subscribes topics for status, draw result and payout events.',
|
||||
'subscribe_topics' => $topics,
|
||||
'sample_messages' => [
|
||||
|
||||
Reference in New Issue
Block a user