正在显示
1 个修改的文件
包含
8 行增加
和
8 行删除
| @@ -455,7 +455,7 @@ if (!function_exists('getImageUrl')) { | @@ -455,7 +455,7 @@ if (!function_exists('getImageUrl')) { | ||
| 455 | * @method :post | 455 | * @method :post |
| 456 | * @time :2023/7/20 16:46 | 456 | * @time :2023/7/20 16:46 |
| 457 | */ | 457 | */ |
| 458 | - function getImageUrl($path,$storage_type = 0){ | 458 | + function getImageUrl($path,$storage_type = 0,$location = 1){ |
| 459 | if(is_array($path)){ | 459 | if(is_array($path)){ |
| 460 | $url =[]; | 460 | $url =[]; |
| 461 | foreach ($path as $v){ | 461 | foreach ($path as $v){ |
| @@ -471,12 +471,12 @@ if (!function_exists('getImageUrl')) { | @@ -471,12 +471,12 @@ if (!function_exists('getImageUrl')) { | ||
| 471 | if(substr($path,0,2) == '//'){ | 471 | if(substr($path,0,2) == '//'){ |
| 472 | return 'https:'.$path; | 472 | return 'https:'.$path; |
| 473 | } | 473 | } |
| 474 | - $imageModel = new Image(); | ||
| 475 | - $imageInfo = $imageModel->read(['path'=>$path],['is_cos']); | ||
| 476 | - if($imageInfo === false){ | ||
| 477 | - return ''; | ||
| 478 | - } | ||
| 479 | - if($imageInfo['is_cos'] == 1){ | 474 | +// $imageModel = new Image(); |
| 475 | +// $imageInfo = $imageModel->read(['path'=>$path],['is_cos']); | ||
| 476 | +// if($imageInfo === false){ | ||
| 477 | +// return ''; | ||
| 478 | +// } | ||
| 479 | + if($location == 1){ | ||
| 480 | $cos = config('filesystems.disks.cos'); | 480 | $cos = config('filesystems.disks.cos'); |
| 481 | $cosCdn = ($storage_type == 0) ? $cos['cdn'] : $cos['cdn1']; | 481 | $cosCdn = ($storage_type == 0) ? $cos['cdn'] : $cos['cdn1']; |
| 482 | $url = $cosCdn.$path; | 482 | $url = $cosCdn.$path; |
| @@ -498,7 +498,7 @@ if (!function_exists('getFileUrl')) { | @@ -498,7 +498,7 @@ if (!function_exists('getFileUrl')) { | ||
| 498 | * @method :post | 498 | * @method :post |
| 499 | * @time :2023/7/20 16:46 | 499 | * @time :2023/7/20 16:46 |
| 500 | */ | 500 | */ |
| 501 | - function getFileUrl($path,$storage_type = 0){ | 501 | + function getFileUrl($path,$storage_type = 0,$location = 1){ |
| 502 | if(is_array($path)){ | 502 | if(is_array($path)){ |
| 503 | $url =[]; | 503 | $url =[]; |
| 504 | foreach ($path as $v){ | 504 | foreach ($path as $v){ |
-
请 注册 或 登录 后发表评论