app路由检测改进 支持对 根目录 / 访问设置路由

This commit is contained in:
thinkphp
2016-01-05 16:14:20 +08:00
parent fa3a084dd6
commit 1c614d9da9
2 changed files with 23 additions and 25 deletions

View File

@@ -241,15 +241,16 @@ class Route
// 检测域名部署
self::checkDomain();
if (isset(self::$bind['module'])) {
// 如果有模块/控制器绑定
$url = implode('/', self::$bind['module']) . '/' . $url;
}
// 优先检测是否存在PATH_INFO
if (empty($url)) {
$url = '/';
}
if (isset(self::$bind['module'])) {
$url = implode('/', self::$bind['module']) . '/' . $url;
}
// 分隔符替换 确保路由定义使用统一的分隔符
if ('/' != $depr) {
$url = str_replace($depr, '/', $url);