diff --git a/library/think/View.php b/library/think/View.php index 6a96b740..b724ba91 100644 --- a/library/think/View.php +++ b/library/think/View.php @@ -40,9 +40,9 @@ class View // 基础替换字符串 $request = Request::instance(); $base = $request->root(); - $root = strpos($base, '.') ? ltrim(dirname($base), '\\') : $base; + $root = strpos($base, '.') ? ltrim(dirname($base), DS) : $base; if ('' != $root) { - $root = '/' . $root; + $root = '/' . ltrim($root, '/'); } $baseReplace = [ '__ROOT__' => $root,