mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
[更新]修改服务器URL根计算方法
This commit is contained in:
parent
3b91c084d9
commit
c8015228ee
@ -40,7 +40,7 @@ class FilterView
|
|||||||
{
|
{
|
||||||
$this->request = Request::instance();
|
$this->request = Request::instance();
|
||||||
list($appRoot, $uriSelf) = [$this->request->root(true), $this->request->url(true)];
|
list($appRoot, $uriSelf) = [$this->request->root(true), $this->request->url(true)];
|
||||||
$uriRoot = strpos($appRoot, EXT) ? ltrim(dirname($appRoot), DS) : $appRoot;
|
$uriRoot = preg_match('/\.php$/', $appRoot) ? dirname($appRoot) : $appRoot;
|
||||||
$uriStatic = "{$uriRoot}/static";
|
$uriStatic = "{$uriRoot}/static";
|
||||||
$replace = ['__APP__' => $appRoot, '__SELF__' => $uriSelf, '__PUBLIC__' => $uriRoot, '__STATIC__' => $uriStatic];
|
$replace = ['__APP__' => $appRoot, '__SELF__' => $uriSelf, '__PUBLIC__' => $uriRoot, '__STATIC__' => $uriStatic];
|
||||||
$params = str_replace(array_keys($replace), array_values($replace), $params);
|
$params = str_replace(array_keys($replace), array_values($replace), $params);
|
||||||
|
@ -131,13 +131,9 @@ class FileService
|
|||||||
*/
|
*/
|
||||||
public static function getBaseUriLocal()
|
public static function getBaseUriLocal()
|
||||||
{
|
{
|
||||||
$request = request();
|
$appRoot = request()->root(true);
|
||||||
$base = $request->root();
|
$uriRoot = preg_match('/\.php$/', $appRoot) ? dirname($appRoot) : $appRoot;
|
||||||
$root = strpos($base, '.') ? ltrim(dirname($base), DS) : $base;
|
return "{$uriRoot}/static/upload/";
|
||||||
if ('' != $root) {
|
|
||||||
$root = '/' . ltrim($root, '/');
|
|
||||||
}
|
|
||||||
return ($request->isSsl() ? 'https' : 'http') . '://' . $request->host() . "{$root}/static/upload/";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user