1.提交缺失的东西

This commit is contained in:
2025-05-12 17:21:54 +08:00
parent 852502f17a
commit 8f37ccb794

View File

@ -57,18 +57,22 @@ class UrlServer
}
$protocol = is_https() ? 'https://' : 'http://';
$file_url = config('project.file_domain');
if ($file_url[strlen($file_url) - 1] == '/') {
$file_url = substr($file_url,0,strlen($file_url)-1);
$port = request()->port();
$port = in_array($port, [ '80', '443' ]) ? '' : ":{$port}";
$file_url .= $port;
}
return $protocol . $file_url . $uri;
// if ($file_url[strlen($file_url) - 1] == '/') {
// $file_url = substr($file_url,0,strlen($file_url)-1);
//
// $port = request()->port();
// $port = in_array($port, [ '80', '443' ]) ? '' : ":{$port}";
//
// $file_url .= $port;
// }
// return $protocol . $file_url . $uri;
$domain = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://";
$domain .= $_SERVER['HTTP_HOST'];
return $domain.$uri;
} else {
$config = ConfigServer::get('storage_engine',$engine);