up. 优化代码内容
This commit is contained in:
parent
c2e2d69a29
commit
3c21643d0f
@ -20,6 +20,6 @@ return [
|
|||||||
/*
|
/*
|
||||||
* 网关事件订阅类
|
* 网关事件订阅类
|
||||||
*/
|
*/
|
||||||
'gateway' => GatewaySubscribe::class,
|
GatewaySubscribe::class,
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|||||||
@ -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(),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user