mirror of
https://gitee.com/ulthon/ulthon_information.git
synced 2026-03-04 00:24:29 +08:00
完善路由和域名;
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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<category_id?>/s<sub_category_id?>/p<page?>', 'Index/index');
|
||||
Route::rule('i<category_id?>/s/p<page?>', 'Index/index');
|
||||
Route::rule('i/s/p<page?>', 'Index/index');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user