mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-09 16:12:49 +08:00
修正路由
This commit is contained in:
@@ -754,7 +754,7 @@ class Route
|
|||||||
}
|
}
|
||||||
if (isset($miss)) {
|
if (isset($miss)) {
|
||||||
// 未匹配所有路由的路由规则处理
|
// 未匹配所有路由的路由规则处理
|
||||||
return self::parseRule('', $miss, $url);
|
return self::parseRule('', $miss['route'], $url);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1162,7 +1162,7 @@ class Route
|
|||||||
$paths = explode('/', $pathinfo);
|
$paths = explode('/', $pathinfo);
|
||||||
}
|
}
|
||||||
// 获取路由地址规则
|
// 获取路由地址规则
|
||||||
$url = is_array($route) ? $route[0] : $route;
|
$url = $route;
|
||||||
// 替换路由地址中的变量
|
// 替换路由地址中的变量
|
||||||
if (is_string($url) && !empty($matches)) {
|
if (is_string($url) && !empty($matches)) {
|
||||||
foreach ($matches as $key => $val) {
|
foreach ($matches as $key => $val) {
|
||||||
@@ -1177,7 +1177,7 @@ class Route
|
|||||||
$result = ['type' => 'function', 'function' => $url, 'params' => $matches];
|
$result = ['type' => 'function', 'function' => $url, 'params' => $matches];
|
||||||
} elseif (0 === strpos($url, '/') || 0 === strpos($url, 'http')) {
|
} elseif (0 === strpos($url, '/') || 0 === strpos($url, 'http')) {
|
||||||
// 路由到重定向地址
|
// 路由到重定向地址
|
||||||
$result = ['type' => 'redirect', 'url' => $url, 'status' => (is_array($route) && isset($route[1])) ? $route[1] : 301];
|
$result = ['type' => 'redirect', 'url' => $url, 'status' => isset($option['status']) ? $option['status'] : 301];
|
||||||
} elseif (0 === strpos($url, '\\')) {
|
} elseif (0 === strpos($url, '\\')) {
|
||||||
// 路由到方法
|
// 路由到方法
|
||||||
$method = strpos($url, '@') ? explode('@', $url) : $url;
|
$method = strpos($url, '@') ? explode('@', $url) : $url;
|
||||||
|
|||||||
Reference in New Issue
Block a user