{{isset($imgName2) ? $imgName2 : '上传图片'}}
@php $_info = $info ?? null; // 兼容旧版 $url/$id 参数 if (!$_info && isset($url) && $url) { $_info = (object)[ 'url' => $url, 'id' => $id ?? '', 'file_name' => $fileName ?? basename($url), ]; } // 推断 format:优先用 file_name 扩展名,其次用 url 扩展名 $_format = ''; if ($_info && !empty($_info->url)) { if (!empty($_info->file_name)) { $_format = strtolower(pathinfo($_info->file_name, PATHINFO_EXTENSION)); } if (!$_format) { $_format = strtolower(pathinfo(parse_url($_info->url, PHP_URL_PATH), PATHINFO_EXTENSION)); } } $_isImage = in_array($_format, ['jpg','jpeg','png','gif','bmp','webp']); @endphp @if(isset($_info) && !empty($_info->url) && $_isImage)

X

@elseif(isset($_info) && !empty($_info->url))

{{$_info->file_name ?? '文件'}}X

@endif
@if(isset($spk))
* {{$spk}}
@endif