Skip to content

Commit

Permalink
feature: 支持二级目录访问
Browse files Browse the repository at this point in the history
  • Loading branch information
krissss committed Jan 10, 2024
1 parent f802e5f commit 5aca982
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Controller/SymfonyResponseLogReaderController.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ protected function getRequest(): SymfonyRequest

protected function getBaseUrl(): string
{
return config('plugin.webman-tech.log-reader.log-reader.route.group', '');
$urlMaker = config('plugin.webman-tech.log-reader.log-reader.route.url_maker');
$url = config('plugin.webman-tech.log-reader.log-reader.route.group', '');
if (is_callable($urlMaker)) {
$url = $urlMaker($url);
}
return $url;
}
}
2 changes: 2 additions & 0 deletions src/config/plugin/webman-tech/log-reader/log-reader.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
'group' => '/log-reader',
// 路由中间件,可以用于控制访问权限
'middleware' => [],
// 路由创建,fn(string $url) => string,用于二级目录访问场景
'url_maker' => null,
],
/**
* 以下参数为 LogReader 的属性参数
Expand Down

0 comments on commit 5aca982

Please sign in to comment.