mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-08 07:32:48 +08:00
改进
This commit is contained in:
@@ -4,7 +4,8 @@ return [
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | 应用设置
|
// | 应用设置
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
|
// 默认Host地址
|
||||||
|
'app_host' => '',
|
||||||
// 应用调试模式
|
// 应用调试模式
|
||||||
'app_debug' => true,
|
'app_debug' => true,
|
||||||
// 应用Trace
|
// 应用Trace
|
||||||
@@ -89,8 +90,6 @@ return [
|
|||||||
'url_route_must' => false,
|
'url_route_must' => false,
|
||||||
// 域名部署
|
// 域名部署
|
||||||
'url_domain_deploy' => false,
|
'url_domain_deploy' => false,
|
||||||
// 默认Host地址
|
|
||||||
'default_host' => '',
|
|
||||||
// 域名根,如thinkphp.cn
|
// 域名根,如thinkphp.cn
|
||||||
'url_domain_root' => '',
|
'url_domain_root' => '',
|
||||||
// 是否自动转换URL中的控制器和操作名
|
// 是否自动转换URL中的控制器和操作名
|
||||||
|
|||||||
@@ -235,7 +235,7 @@ class Url
|
|||||||
$rootDomain = Config::get('url_domain_root');
|
$rootDomain = Config::get('url_domain_root');
|
||||||
if (true === $domain) {
|
if (true === $domain) {
|
||||||
// 自动判断域名
|
// 自动判断域名
|
||||||
$domain = Config::get('default_host') ?: $request->host();
|
$domain = Config::get('app_host') ?: $request->host();
|
||||||
|
|
||||||
$domains = Route::rules('domain');
|
$domains = Route::rules('domain');
|
||||||
if ($domains) {
|
if ($domains) {
|
||||||
@@ -265,7 +265,7 @@ class Url
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (empty($rootDomain)) {
|
if (empty($rootDomain)) {
|
||||||
$host = Config::get('default_host') ?: $request->host();
|
$host = Config::get('app_host') ?: $request->host();
|
||||||
$rootDomain = substr_count($host, '.') > 1 ? substr(strstr($host, '.'), 1) : $host;
|
$rootDomain = substr_count($host, '.') > 1 ? substr(strstr($host, '.'), 1) : $host;
|
||||||
}
|
}
|
||||||
if (substr_count($domain, '.') < 2 && !strpos($domain, $rootDomain)) {
|
if (substr_count($domain, '.') < 2 && !strpos($domain, $rootDomain)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user