fix: fall back to default public avatar image if user has no avatar

This commit is contained in:
antv
2026-07-08 15:50:44 +07:00
parent bdd58e0d17
commit 9aee6d612c
3 changed files with 3 additions and 5 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 392 KiB

+1 -3
View File
@@ -55,9 +55,7 @@
@php
$avatarUrl = Auth::check() && Auth::user()->avatar
? Auth::user()->avatar
: (Auth::check() && Auth::user()->name
? 'https://api.dicebear.com/7.x/notionists/svg?seed=' . urlencode(Auth::user()->name) . '&backgroundColor=e2e8f0'
: asset('images/avatar.png'));
: asset('images/avatar.png');
$deptName = 'Product Team';
if (Auth::check()) {
@@ -15,7 +15,7 @@
rank="{{ $item->rank }}"
name="{{ $item->name }}"
team="{{ $teamName }}"
avatar="{{ $item->avatar ?? 'https://api.dicebear.com/7.x/notionists/svg?seed=' . urlencode($item->name) . '&backgroundColor=bfdbfe' }}"
avatar="{{ $item->avatar ? $item->avatar : asset('images/avatar.png') }}"
score="{{ $item->score }}"
unit="thẻ"
:isCurrent="$item->msnv == Auth::user()->msnv"
@@ -45,7 +45,7 @@
rank="{{ $currentUserRankItem->rank > 0 ? $currentUserRankItem->rank : '-' }}"
name="{{ $currentUserRankItem->name }}"
team="{{ $currTeamName }}"
avatar="{{ $currentUserRankItem->avatar ?? 'https://api.dicebear.com/7.x/notionists/svg?seed=' . urlencode($currentUserRankItem->name) . '&backgroundColor=bfdbfe' }}"
avatar="{{ $currentUserRankItem->avatar ? $currentUserRankItem->avatar : asset('images/avatar.png') }}"
score="{{ $currentUserRankItem->score }}"
unit="thẻ"
:isCurrent="true"