[更新]修改文件服务获取本地上传地址

This commit is contained in:
Anyon 2018-05-29 11:36:23 +08:00
parent a79b0cab29
commit 42573daa72

View File

@ -156,7 +156,7 @@ class FileService
*/ */
public static function getBaseUriLocal() public static function getBaseUriLocal()
{ {
$appRoot = request()->root(true); // 如果你想获取相对url地址这里把掉参数 true $appRoot = trim(request()->root(true),'\\/'); // 如果你想获取相对url地址这里把掉参数 true
$uriRoot = preg_match('/\.php$/', $appRoot) ? dirname($appRoot) : $appRoot; $uriRoot = preg_match('/\.php$/', $appRoot) ? dirname($appRoot) : $appRoot;
return "{$uriRoot}/static/upload/"; return "{$uriRoot}/static/upload/";
} }