mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
[更新]修改本地文件上传地址
This commit is contained in:
parent
584837cb28
commit
64366a684a
@ -156,8 +156,9 @@ class FileService
|
|||||||
*/
|
*/
|
||||||
public static function getBaseUriLocal()
|
public static function getBaseUriLocal()
|
||||||
{
|
{
|
||||||
$appRoot = request()->root(true); // 如果你想获取相对url地址,这里去掉参数 true
|
$appRoot = request()->root(true); // 去掉参数 true 将获得相对地址
|
||||||
$uriRoot = preg_match('/\.php$/', $appRoot) ? dirname($appRoot) : $appRoot;
|
$uriRoot = preg_match('/\.php$/', $appRoot) ? dirname($appRoot) : $appRoot;
|
||||||
|
$uriRoot = in_array($uriRoot, ['/', '\\']) ? '' : $uriRoot;
|
||||||
return "{$uriRoot}/static/upload/";
|
return "{$uriRoot}/static/upload/";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user