diff --git a/app/Http/Controllers/ChatController.php b/app/Http/Controllers/ChatController.php index eeb9442..191604f 100644 --- a/app/Http/Controllers/ChatController.php +++ b/app/Http/Controllers/ChatController.php @@ -124,6 +124,7 @@ class ChatController extends Controller broadcast(new UserJoined($id, $user->username, $userData))->toOthers(); // 新人首次进入:赠送 6666 金币、播放满场烟花、发送全场欢迎通告 + $user->refresh(); if (! $user->has_received_new_gift) { // 通过统一积分服务发放新人礼包 6666 金币并记录流水 $this->currencyService->change( diff --git a/resources/views/chat/partials/scripts.blade.php b/resources/views/chat/partials/scripts.blade.php index 302323a..ba85268 100644 --- a/resources/views/chat/partials/scripts.blade.php +++ b/resources/views/chat/partials/scripts.blade.php @@ -2212,16 +2212,9 @@ } const safeIcon = escapeHtml(status.icon); - const safeLabel = escapeHtml(status.label); const safeTooltip = escapeHtml(`${status.group} · ${status.label}`); - return ` - - ${safeIcon} - ${safeLabel} - - `; + return `${safeIcon}`; } /** @@ -2232,27 +2225,17 @@ */ function buildUserSignIdentityBadgeHtml(user) { const identityKey = String(user.sign_identity_key ?? user.sign_identity ?? ''); - const identityLabel = String(user.sign_identity_label ?? user.sign_identity_name ?? ''); const identityIcon = String(user.sign_identity_icon ?? ''); - if (!identityKey || !identityLabel || !identityIcon) { + if (!identityKey || !identityIcon) { return ''; } - const color = String(user.sign_identity_color || '#0f766e'); - const bgColor = String(user.sign_identity_bg_color || '#ccfbf1'); - const borderColor = String(user.sign_identity_border_color || '#5eead4'); + const identityLabel = String(user.sign_identity_label ?? user.sign_identity_name ?? ''); const safeIcon = escapeHtml(identityIcon); - const safeLabel = escapeHtml(identityLabel); - const safeTooltip = escapeHtml(`签到 · ${identityLabel}`); + const safeTooltip = escapeHtml(identityLabel ? `签到 · ${identityLabel}` : '签到身份'); - return ` - - ${safeIcon} - ${safeLabel} - - `; + return `${safeIcon}`; } /**