mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-10 00:22:48 +08:00
优化Route类的domain方法
This commit is contained in:
@@ -101,8 +101,7 @@ class Route
|
|||||||
foreach ($domain as $key => $item) {
|
foreach ($domain as $key => $item) {
|
||||||
self::domain($key, $item, $option, $pattern);
|
self::domain($key, $item, $option, $pattern);
|
||||||
}
|
}
|
||||||
} else {
|
} elseif ($rule instanceof \Closure) {
|
||||||
if ($rule instanceof \Closure) {
|
|
||||||
// 执行闭包
|
// 执行闭包
|
||||||
self::setDomain($domain);
|
self::setDomain($domain);
|
||||||
call_user_func_array($rule, []);
|
call_user_func_array($rule, []);
|
||||||
@@ -117,7 +116,7 @@ class Route
|
|||||||
} else {
|
} else {
|
||||||
self::$rules['domain'][$domain]['[bind]'] = [$rule, $option, $pattern];
|
self::$rules['domain'][$domain]['[bind]'] = [$rule, $option, $pattern];
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function setDomain($domain)
|
private static function setDomain($domain)
|
||||||
|
|||||||
Reference in New Issue
Block a user