From 5fb65905654b3c501c7359541c7f94bb0de4b549 Mon Sep 17 00:00:00 2001 From: augushong Date: Fri, 11 Feb 2022 20:20:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E8=B7=AF=E7=94=B1=E5=92=8C?= =?UTF-8?q?=E5=9F=9F=E5=90=8D;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 5 ++++- .htaccess | 1 + app/common.php | 18 ------------------ app/index/route/index.php | 4 +++- config/app.php | 4 ---- view/admin/common/_header.html | 2 +- 6 files changed, 9 insertions(+), 25 deletions(-) create mode 100644 .htaccess diff --git a/.gitignore b/.gitignore index edb9ed5..1a1ff3e 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,7 @@ .env ul.db composer.lock -public/upload/* \ No newline at end of file +public/upload/* +/public/.well-known +/public/.user.ini +.well-known \ No newline at end of file diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/.htaccess @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/common.php b/app/common.php index a8da43f..70d693b 100644 --- a/app/common.php +++ b/app/common.php @@ -273,24 +273,6 @@ function check_permission($key,$admin_id = null) function app_url(string $url = '', array $vars = [], $suffix = true, $domain = false) { - $url_result = explode('@', $url); - - // 在这里,@首先认为是应用名,而不是域名(或子域名) - if (isset($url_result[1])) { - $app_default_doamin = config('app.app_default_doamin'); - if (empty($app_default_doamin)) { - $app_domain_bind = config('app.domain_bind'); - - if (!empty($app_domain_bind)) { - $app_default_doamin = array_flip($app_domain_bind); - } - } - - if (isset($app_default_doamin[$url_result[1]]) && $app_default_doamin[$url_result[1]] != '*') { - - $url = $url_result[0] . "@" . $app_default_doamin[$url_result[1]]; - } - } return url($url, $vars, $suffix, $domain); } diff --git a/app/index/route/index.php b/app/index/route/index.php index bd8b4ca..29fc3c5 100644 --- a/app/index/route/index.php +++ b/app/index/route/index.php @@ -3,5 +3,7 @@ use think\facade\Route; Route::rule('a:uid', 'Post/read'); -Route::rule('i[:category_id]/s[:sub_category_id]/p[:page]', 'Index/index'); +Route::rule('i/s/p', 'Index/index'); +Route::rule('i/s/p', 'Index/index'); +Route::rule('i/s/p', 'Index/index'); diff --git a/config/app.php b/config/app.php index 06d77d3..f722323 100644 --- a/config/app.php +++ b/config/app.php @@ -23,10 +23,6 @@ return [ 'app_map' => [], // 域名绑定(自动多应用模式有效) 'domain_bind' => [ - 'www'=>'index', - 'admin'=>'admin', - 'api'=>'api', - '*'=>'index', ], // 应用默认域名(自动多应用模式有效,为空时采用domain_bind的设置键值对换,适合跨应用生成url) 'app_default_doamin' => [], diff --git a/view/admin/common/_header.html b/view/admin/common/_header.html index 0b62c60..edd958a 100644 --- a/view/admin/common/_header.html +++ b/view/admin/common/_header.html @@ -1,6 +1,6 @@