修复:排行榜/留言板缺失布局、退出登录跳转、WebSocket 配置与部署文档

- 修复 LeaderboardController 查询不存在的 sign 字段导致 500 错误
- 修复 leaderboard/index 和 guestbook/index 引用不存在的 layouts.app 布局
- 将排行榜和留言板改为独立 HTML 页面结构(含 Tailwind CDN)
- 修复退出登录返回 JSON 而非重定向的问题,现在会正确跳转回登录页
- 将 REDIS_CLIENT 从 phpredis 改为 predis(兼容无扩展环境)
- 新增 RoomSeeder 自动创建默认公共大厅房间
- 新增 Nginx 生产环境配置示例(含 WebSocket 反向代理)
- 重写 README.md 为完整的中文部署指南
- 修复 rooms/index 和 chat/frame 中 Alpine.js 语法错误
- 将 chat.js 加入 Vite 构建配置
- 新增验证码配置文件
This commit is contained in:
2026-02-26 14:57:24 +08:00
parent 50fc804402
commit d884853968
19 changed files with 1083 additions and 458 deletions
@@ -15,40 +15,41 @@
$rowBg = 'bg-orange-50 hover:bg-orange-100 border-l-4 border-orange-300';
}
@endphp
<li class="p-3 flex items-center justify-between transition-colors duration-150 {{ $rowBg }}">
<!-- 左侧:名次与头像/名字 -->
<div class="flex items-center space-x-3 overflow-hidden">
<div
class="w-6 h-6 shrink-0 {{ $rankBg }} rounded-full flex items-center justify-center font-bold text-xs">
{{ $index + 1 }}
</div>
<div class="flex items-center space-x-2 truncate">
<img class="w-8 h-8 rounded border object-cover shrink-0"
src="/images/headface/{{ $user->headface ?? '01.gif' }}" alt="">
<div class="flex flex-col truncate">
<span class="text-sm font-bold text-gray-800 truncate" title="{{ $user->username }}">
{{ $user->username }}
@if ($user->sex == '女')
<span class="text-pink-500 text-xs ml-0.5"></span>
@elseif($user->sex == '男')
<span class="text-blue-500 text-xs ml-0.5"></span>
@endif
</span>
<span class="text-[10px] text-gray-500 truncate"
title="{{ $user->sign }}">{{ $user->sign ?: '这家伙很懒,什么也没留下' }}</span>
@if ($user)
<li class="p-3 flex items-center justify-between transition-colors duration-150 {{ $rowBg }}">
<!-- 左侧:名次与头像/名字 -->
<div class="flex items-center space-x-3 overflow-hidden">
<div
class="w-6 h-6 shrink-0 {{ $rankBg }} rounded-full flex items-center justify-center font-bold text-xs">
{{ $index + 1 }}
</div>
<div class="flex items-center space-x-2 truncate">
<img class="w-8 h-8 rounded border object-cover shrink-0"
src="/images/headface/{{ $user->headface ?? '01.gif' }}" alt="">
<div class="flex flex-col truncate">
<span class="text-sm font-bold text-gray-800 truncate" title="{{ $user->username }}">
{{ $user->username }}
@if ($user->sex == '女')
<span class="text-pink-500 text-xs ml-0.5"></span>
@elseif($user->sex == '男')
<span class="text-blue-500 text-xs ml-0.5"></span>
@endif
</span>
<span class="text-[10px] text-gray-500 truncate">暂无个性签名</span>
</div>
</div>
</div>
</div>
<!-- 右侧:数值 -->
<div class="flex flex-col items-end shrink-0 ml-2">
<span class="text-sm font-black {{ $index < 3 ? $color : 'text-gray-600' }}">
{{ number_format($user->$valueField) }}
<span
class="text-[10px] font-normal {{ $index < 3 ? $color : 'text-gray-400' }} ml-0.5">{{ $unit }}</span>
</span>
</div>
</li>
<!-- 右侧:数值 -->
<div class="flex flex-col items-end shrink-0 ml-2">
<span class="text-sm font-black {{ $index < 3 ? $color : 'text-gray-600' }}">
{{ number_format($user->$valueField) }}
<span
class="text-[10px] font-normal {{ $index < 3 ? $color : 'text-gray-400' }} ml-0.5">{{ $unit }}</span>
</span>
</div>
</li>
@endif
@empty
<li class="p-8 text-center text-sm text-gray-400 font-bold">
暂无数据登榜