作者 lyh

gx

@@ -594,14 +594,21 @@ if (!function_exists('getFileUrl')) { @@ -594,14 +594,21 @@ if (!function_exists('getFileUrl')) {
594 if(substr($path,0,2) == '//'){ 594 if(substr($path,0,2) == '//'){
595 return 'https:'.$path; 595 return 'https:'.$path;
596 } 596 }
  597 + $file_type = pathinfo($path, PATHINFO_EXTENSION);
  598 + $fileTypeArr = ['zip', 'pdf', 'mp4', 'doc', 'docx', 'm4v', 'xlsx'];
  599 + if(in_array(strtolower($file_type),$fileTypeArr)){
  600 + $cdn2 = config('filesystems.disks.cos')['cdn2'];
  601 + return $cdn2.$path;
  602 + }
597 if($location == 0){ 603 if($location == 0){
  604 + //v6-file.globalso.com
598 $cos = config('filesystems.disks.cos'); 605 $cos = config('filesystems.disks.cos');
599 $cosCdn = ($storage_type == 0) ? $cos['cdn'] : $cos['cdn1']; 606 $cosCdn = ($storage_type == 0) ? $cos['cdn'] : $cos['cdn1'];
600 - $url = $cosCdn.$path; 607 + return $cosCdn.$path;
601 }else{ 608 }else{
602 $s3 = config('filesystems.disks.s3'); 609 $s3 = config('filesystems.disks.s3');
603 $cdn = $s3['cdn']; 610 $cdn = $s3['cdn'];
604 - $url = $cdn.$path; 611 + return $cdn.$path;
605 } 612 }
606 } 613 }
607 return $url; 614 return $url;
@@ -80,6 +80,7 @@ return [ @@ -80,6 +80,7 @@ return [
80 'bucket' => env('COS_BUCKET'), 80 'bucket' => env('COS_BUCKET'),
81 'cdn' => env('COS_CDN'), 81 'cdn' => env('COS_CDN'),
82 'cdn1' => env('COS_CDN1'), 82 'cdn1' => env('COS_CDN1'),
  83 + 'cdn2' => env('COS_CDN2'),
83 'timeout' => 60, 84 'timeout' => 60,
84 'connect_timeout' => 60, 85 'connect_timeout' => 60,
85 ], 86 ],