作者 lyh

gx

@@ -477,7 +477,9 @@ if (!function_exists('getImageUrl')) { @@ -477,7 +477,9 @@ if (!function_exists('getImageUrl')) {
477 $cosCdn = ($storage_type == 0) ? $cos['cdn'] : $cos['cdn1']; 477 $cosCdn = ($storage_type == 0) ? $cos['cdn'] : $cos['cdn1'];
478 $url = $cosCdn.$path; 478 $url = $cosCdn.$path;
479 }else{ 479 }else{
480 - $url = url($path); 480 + $s3 = config('filesystems.disks.s3');
  481 + $cdn = $s3['cdn'];
  482 + $url = $cdn.$path;
481 } 483 }
482 } 484 }
483 return $url; 485 return $url;
@@ -513,7 +515,9 @@ if (!function_exists('getFileUrl')) { @@ -513,7 +515,9 @@ if (!function_exists('getFileUrl')) {
513 $cosCdn = ($storage_type == 0) ? $cos['cdn'] : $cos['cdn1']; 515 $cosCdn = ($storage_type == 0) ? $cos['cdn'] : $cos['cdn1'];
514 $url = $cosCdn.$path; 516 $url = $cosCdn.$path;
515 }else{ 517 }else{
516 - $url = url($path); 518 + $s3 = config('filesystems.disks.s3');
  519 + $cdn = $s3['cdn'];
  520 + $url = $cdn.$path;
517 } 521 }
518 } 522 }
519 return $url; 523 return $url;
@@ -563,7 +567,8 @@ if (!function_exists('str_replace_url')) { @@ -563,7 +567,8 @@ if (!function_exists('str_replace_url')) {
563 { 567 {
564 $cos = config('filesystems.disks.cos'); 568 $cos = config('filesystems.disks.cos');
565 $cosCdn = $cos['cdn']; 569 $cosCdn = $cos['cdn'];
566 - if($url && strpos($url,$cosCdn) !== false){ 570 + $cosCdn1 = $cos['cdn1'];
  571 + if($url && ((strpos($url,$cosCdn) !== false) || (strpos($url,$cosCdn1) !== false))){
567 // 外部URL无需解析 572 // 外部URL无需解析
568 // 使用 parse_url 函数来解析 URL 573 // 使用 parse_url 函数来解析 URL
569 $urlParts = parse_url($url); 574 $urlParts = parse_url($url);
@@ -51,6 +51,7 @@ return [ @@ -51,6 +51,7 @@ return [
51 'url' => env('AWS_URL'), 51 'url' => env('AWS_URL'),
52 'endpoint' => env('AWS_ENDPOINT'), 52 'endpoint' => env('AWS_ENDPOINT'),
53 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false), 53 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
  54 + 'cdn'=>'https://globalso-v6.s3.us-west-2.amazonaws.com/'
54 ], 55 ],
55 56
56 'upload' => [ 57 'upload' => [