正在显示
1 个修改的文件
包含
8 行增加
和
6 行删除
| @@ -421,17 +421,19 @@ if (!function_exists('getImageUrl')) { | @@ -421,17 +421,19 @@ if (!function_exists('getImageUrl')) { | ||
| 421 | * @time :2023/7/20 16:46 | 421 | * @time :2023/7/20 16:46 |
| 422 | */ | 422 | */ |
| 423 | function getImageUrl($path,$location = 1){ | 423 | function getImageUrl($path,$location = 1){ |
| 424 | - if(empty($path)){ | ||
| 425 | - return ''; | ||
| 426 | - } | ||
| 427 | - if((strpos($path,'https://')!== false) || (strpos($path,'http://') !== false)){ | ||
| 428 | - return $path; | ||
| 429 | - } | ||
| 430 | if(is_array($path)){ | 424 | if(is_array($path)){ |
| 425 | + $url =[]; | ||
| 431 | foreach ($path as $v){ | 426 | foreach ($path as $v){ |
| 432 | $url[] = getImageUrl($v); | 427 | $url[] = getImageUrl($v); |
| 433 | } | 428 | } |
| 429 | + $url = array_filter($url); | ||
| 434 | }else{ | 430 | }else{ |
| 431 | + if(empty($path)){ | ||
| 432 | + return ''; | ||
| 433 | + } | ||
| 434 | + if((strpos($path,'https://')!== false) || (strpos($path,'http://') !== false)){ | ||
| 435 | + return $path; | ||
| 436 | + } | ||
| 435 | if($location == 1){ | 437 | if($location == 1){ |
| 436 | $cos = config('filesystems.disks.cos'); | 438 | $cos = config('filesystems.disks.cos'); |
| 437 | $cosCdn = $cos['cdn']; | 439 | $cosCdn = $cos['cdn']; |
-
请 注册 或 登录 后发表评论