推送模块
This commit is contained in:
24
app/common/library/admin/PushChannelConfigHelper.php
Normal file
24
app/common/library/admin/PushChannelConfigHelper.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\common\library\admin;
|
||||
|
||||
/**
|
||||
* 后台推送测试页:读取 webman/push 配置(与 game/Live::pushConfig 口径一致)
|
||||
*/
|
||||
final class PushChannelConfigHelper
|
||||
{
|
||||
public static function wsBaseUrl(): string
|
||||
{
|
||||
$ws = (string) config('plugin.webman.push.app.websocket');
|
||||
$ws = str_replace('websocket://', 'ws://', $ws);
|
||||
|
||||
return str_replace('0.0.0.0', '127.0.0.1', $ws);
|
||||
}
|
||||
|
||||
public static function appKey(): string
|
||||
{
|
||||
return (string) config('plugin.webman.push.app.app_key');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user