diff --git a/app/event.php b/app/event.php index 160c0cd..9203cf3 100644 --- a/app/event.php +++ b/app/event.php @@ -20,6 +20,6 @@ return [ /* * 网关事件订阅类 */ - 'gateway' => GatewaySubscribe::class, + GatewaySubscribe::class, ], ]; diff --git a/app/subscribe/GatewaySubscribe.php b/app/subscribe/GatewaySubscribe.php index 6bb297e..64b256a 100644 --- a/app/subscribe/GatewaySubscribe.php +++ b/app/subscribe/GatewaySubscribe.php @@ -29,8 +29,8 @@ class GatewaySubscribe public function subscribe(Event $event): void { $event->listen('gateway.clientLogin', [$this,'onClientLogin']); - $event->listen('lockClient',[$this,'onLockClient']); - $event->listen('clientClose',[$this,'onClientClose']); + $event->listen('gateway.lockClient',[$this,'onLockClient']); + $event->listen('gateway.clientClose',[$this,'onClientClose']); } /** @@ -42,11 +42,8 @@ class GatewaySubscribe * @throws DbException * @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_id' => $put->getClientId(), 'client_name'=> $put->getClientName(),