去除管理员登录提示

This commit is contained in:
2026-04-11 15:57:20 +08:00
parent f6fb5aab78
commit ca1c7e66c5
+1 -24
View File
@@ -156,29 +156,7 @@ class ChatController extends Controller
// 每次进入先清理掉历史中旧的欢迎消息,保证同一个人只保留最后一条 // 每次进入先清理掉历史中旧的欢迎消息,保证同一个人只保留最后一条
$this->chatState->removeOldWelcomeMessages($id, $user->username); $this->chatState->removeOldWelcomeMessages($id, $user->username);
if ($user->user_level >= $superLevel) { // 统一走通用进场播报逻辑,管理员不再发送单独的特殊登录提示。
// 管理员专属:全房间烟花
broadcast(new \App\Events\EffectBroadcast($id, 'fireworks', $user->username));
// 传给前端,让管理员自己屏幕上也按规矩加载燃放烟花
$newbieEffect = 'fireworks';
$welcomeMsg = [
'id' => $this->chatState->nextMessageId($id),
'room_id' => $id,
'from_user' => '系统公告',
'to_user' => '大家',
'content' => "🎉 欢迎管理员 【{$user->username}】 驾临本聊天室!请各位文明聊天!",
'is_secret' => false,
'font_color' => '#b91c1c',
'action' => 'admin_welcome',
'welcome_user' => $user->username,
'sent_at' => now()->toDateTimeString(),
];
$this->chatState->pushMessage($id, $welcomeMsg);
broadcast(new MessageSent($id, $welcomeMsg));
} else {
// 非站长:生成通用播报(有职务 > 有VIP > 普通随机词)
[$text, $color] = $this->broadcast->buildEntryBroadcast($user); [$text, $color] = $this->broadcast->buildEntryBroadcast($user);
$vipPresencePayload = $this->broadcast->buildVipPresencePayload($user, 'join'); $vipPresencePayload = $this->broadcast->buildVipPresencePayload($user, 'join');
@@ -210,7 +188,6 @@ class ChatController extends Controller
broadcast(new \App\Events\EffectBroadcast($id, $vipPresencePayload['presence_effect'], $user->username))->toOthers(); broadcast(new \App\Events\EffectBroadcast($id, $vipPresencePayload['presence_effect'], $user->username))->toOthers();
} }
} }
}
// 6. 获取历史消息并过滤,只保留和当前用户相关的消息用于初次渲染 // 6. 获取历史消息并过滤,只保留和当前用户相关的消息用于初次渲染
// 规则:公众发言(to_user=大家 或空)保留;私聊/系统通知只保留涉及本人的 // 规则:公众发言(to_user=大家 或空)保留;私聊/系统通知只保留涉及本人的