作者 lyh

gx

... ... @@ -459,7 +459,7 @@ if (!function_exists('getImageUrl')) {
if(is_array($path)){
$url =[];
foreach ($path as $v){
$url[] = getImageUrl($v,$storage_type);
$url[] = getImageUrl($v,$storage_type,$location);
}
}else{
if(empty($path)){
... ... @@ -502,7 +502,7 @@ if (!function_exists('getFileUrl')) {
if(is_array($path)){
$url =[];
foreach ($path as $v){
$url[] = getFileUrl($v,$storage_type);
$url[] = getFileUrl($v,$storage_type,$location);
}
}else{
if(empty($path)){
... ... @@ -514,12 +514,12 @@ if (!function_exists('getFileUrl')) {
if(substr($path,0,2) == '//'){
return 'https:'.$path;
}
$fileModel = new FileModel();
$fileInfo = $fileModel->read(['path'=>$path],['is_cos']);
if($fileInfo === false){
return '';
}
if($fileInfo['is_cos'] == 1){
// $fileModel = new FileModel();
// $fileInfo = $fileModel->read(['path'=>$path],['is_cos']);
// if($fileInfo === false){
// return '';
// }
if($location == 1){
$cos = config('filesystems.disks.cos');
$cosCdn = ($storage_type == 0) ? $cos['cdn'] : $cos['cdn1'];
$url = $cosCdn.$path;
... ...