Parcourir la source

Update:Fixed path error

Jinhui Zhu il y a 6 ans
Parent
commit
0633155de3
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      src/Request/Url/Base.php

+ 2 - 2
src/Request/Url/Base.php

@@ -182,7 +182,7 @@ abstract class Base
     public function getPath($path = '')
     {
         if (empty($path)) {
-            $path = $_SERVER['REQUEST_URI'];
+            $path = $_SERVER['SCRIPT_NAME'];
         }
         return substr($path, 0, (strrpos($path, '/')));
     }
@@ -393,4 +393,4 @@ abstract class Base
     {
         //防止掉用不存在的方法
     }
-}
+}