修复:全员清屏广播不生效
- ScreenCleared 改用 ShouldBroadcastNow 绕过队列,避免 Horizon 未重启问题 - Echo 监听移入 DOMContentLoaded + 500ms 重试,确保 window.Echo 就绪后再注册 - 添加 console.log 便于调试
This commit is contained in:
@@ -14,11 +14,11 @@ namespace App\Events;
|
||||
|
||||
use Illuminate\Broadcasting\InteractsWithSockets;
|
||||
use Illuminate\Broadcasting\PresenceChannel;
|
||||
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
|
||||
use Illuminate\Contracts\Broadcasting\ShouldBroadcastNow;
|
||||
use Illuminate\Foundation\Events\Dispatchable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class ScreenCleared implements ShouldBroadcast
|
||||
class ScreenCleared implements ShouldBroadcastNow
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user