mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-01 23:42:48 +08:00
31 lines
640 B
PHP
31 lines
640 B
PHP
<?php
|
|
|
|
namespace think\filesystem\driver;
|
|
|
|
use think\facade\Request;
|
|
|
|
class LocalPublic extends Local
|
|
{
|
|
public function url(string $path): string
|
|
{
|
|
|
|
$url = sysconfig('upload', 'local_domain');
|
|
|
|
if (empty($url)) {
|
|
$host = Request::host();
|
|
|
|
if (!empty($host)) {
|
|
$url = Request::domain();
|
|
}
|
|
}
|
|
if (isset($this->config['url'])) {
|
|
$url = trim($url, '/') . '/' . trim($this->config['url'], '/');
|
|
}
|
|
|
|
if (isset($url)) {
|
|
return $this->concatPathToUrl($url, $path);
|
|
}
|
|
return parent::url($path);
|
|
}
|
|
}
|