作者 lyh

gx

... ... @@ -477,7 +477,9 @@ if (!function_exists('getImageUrl')) {
$cosCdn = ($storage_type == 0) ? $cos['cdn'] : $cos['cdn1'];
$url = $cosCdn.$path;
}else{
$url = url($path);
$s3 = config('filesystems.disks.s3');
$cdn = $s3['cdn'];
$url = $cdn.$path;
}
}
return $url;
... ... @@ -513,7 +515,9 @@ if (!function_exists('getFileUrl')) {
$cosCdn = ($storage_type == 0) ? $cos['cdn'] : $cos['cdn1'];
$url = $cosCdn.$path;
}else{
$url = url($path);
$s3 = config('filesystems.disks.s3');
$cdn = $s3['cdn'];
$url = $cdn.$path;
}
}
return $url;
... ... @@ -563,7 +567,8 @@ if (!function_exists('str_replace_url')) {
{
$cos = config('filesystems.disks.cos');
$cosCdn = $cos['cdn'];
if($url && strpos($url,$cosCdn) !== false){
$cosCdn1 = $cos['cdn1'];
if($url && ((strpos($url,$cosCdn) !== false) || (strpos($url,$cosCdn1) !== false))){
// 外部URL无需解析
// 使用 parse_url 函数来解析 URL
$urlParts = parse_url($url);
... ...
... ... @@ -51,6 +51,7 @@ return [
'url' => env('AWS_URL'),
'endpoint' => env('AWS_ENDPOINT'),
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
'cdn'=>'https://globalso-v6.s3.us-west-2.amazonaws.com/'
],
'upload' => [
... ...