mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 15:02:47 +08:00
修正Url类域名部署的问题
This commit is contained in:
@@ -29,7 +29,7 @@ class Url
|
|||||||
* @param boolean|string $domain 是否显示域名 或者直接传入域名
|
* @param boolean|string $domain 是否显示域名 或者直接传入域名
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public static function build($url = '', $vars = '', $suffix = true, $domain = false)
|
public static function build($url = '', $vars = '', $suffix = true, $domain = null)
|
||||||
{
|
{
|
||||||
if (false === $domain && Config::get('url_domain_deploy')) {
|
if (false === $domain && Config::get('url_domain_deploy')) {
|
||||||
$domain = true;
|
$domain = true;
|
||||||
@@ -172,13 +172,14 @@ class Url
|
|||||||
} else {
|
} else {
|
||||||
// 解析到 模块/控制器/操作
|
// 解析到 模块/控制器/操作
|
||||||
$module = $request->module();
|
$module = $request->module();
|
||||||
if (true === $domain) {
|
if (true === $domain && 2 == substr_count($url, '/')) {
|
||||||
$domains = Route::rules('domain');
|
$domains = Route::rules('domain');
|
||||||
foreach ($domains as $key => $item) {
|
foreach ($domains as $key => $item) {
|
||||||
if (isset($item['[bind]']) && 0 === strpos($url, $item['[bind]'][0])) {
|
if (isset($item['[bind]']) && 0 === strpos($url, $item['[bind]'][0])) {
|
||||||
$url = substr($url, strlen($item['[bind]'][0]) + 1);
|
$url = substr($url, strlen($item['[bind]'][0]) + 1);
|
||||||
$domain = $key;
|
$domain = $key;
|
||||||
$module = '';
|
$module = '';
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} elseif ($domain) {
|
} elseif ($domain) {
|
||||||
|
|||||||
Reference in New Issue
Block a user