up. 优化代码内容

This commit is contained in:
扶桑花间 2025-08-29 22:24:29 +08:00
parent c2e2d69a29
commit 3c21643d0f
2 changed files with 4 additions and 7 deletions

View File

@ -20,6 +20,6 @@ return [
/* /*
* 网关事件订阅类 * 网关事件订阅类
*/ */
'gateway' => GatewaySubscribe::class, GatewaySubscribe::class,
], ],
]; ];

View File

@ -29,8 +29,8 @@ class GatewaySubscribe
public function subscribe(Event $event): void public function subscribe(Event $event): void
{ {
$event->listen('gateway.clientLogin', [$this,'onClientLogin']); $event->listen('gateway.clientLogin', [$this,'onClientLogin']);
$event->listen('lockClient',[$this,'onLockClient']); $event->listen('gateway.lockClient',[$this,'onLockClient']);
$event->listen('clientClose',[$this,'onClientClose']); $event->listen('gateway.clientClose',[$this,'onClientClose']);
} }
/** /**
@ -42,11 +42,8 @@ class GatewaySubscribe
* @throws DbException * @throws DbException
* @throws ModelNotFoundException * @throws ModelNotFoundException
*/ */
public function onClientLogin($data): void public function onClientLogin(PutMessage $put, SysUser $sysUser): void
{ {
var_dump($data);
var_dump("事件触发 ");
return;
$client = SysUserClient::where([ $client = SysUserClient::where([
'client_id' => $put->getClientId(), 'client_id' => $put->getClientId(),
'client_name'=> $put->getClientName(), 'client_name'=> $put->getClientName(),