This commit is contained in:
jqh 2020-07-13 11:53:27 +08:00
parent 317d46abea
commit 5396f8d6de
2 changed files with 3 additions and 2 deletions

View File

@ -25,8 +25,8 @@ class DcatLogViewerServiceProvider extends ServiceProvider
'middleware' => config('dcat-log-viewer.route.middleware'), 'middleware' => config('dcat-log-viewer.route.middleware'),
], function ($router) { ], function ($router) {
$router->get('/', ['as' => 'dcat-log-viewer', 'uses' => 'LogController@index',]); $router->get('/', ['as' => 'dcat-log-viewer', 'uses' => 'LogController@index',]);
$router->get('download', ['as' => 'dcat-log-viewer.download', 'uses' => 'LogController@download',]);
$router->get('{file}', ['as' => 'dcat-log-viewer.file', 'uses' => 'LogController@index',]); $router->get('{file}', ['as' => 'dcat-log-viewer.file', 'uses' => 'LogController@index',]);
$router->get('download/{file}', ['as' => 'dcat-log-viewer.download', 'uses' => 'LogController@download',]);
}); });
} }
} }

View File

@ -35,10 +35,11 @@ class LogController
]); ]);
} }
public function download($file = null) public function download()
{ {
$request = app('request'); $request = app('request');
$file = trim($request->get('file'));
$dir = trim($request->get('dir')); $dir = trim($request->get('dir'));
$filename = trim($request->get('filename')); $filename = trim($request->get('filename'));
$keyword = trim($request->get('keyword')); $keyword = trim($request->get('keyword'));