Skip to content
Permalink
Browse files

调整mdui搜索路由问题

  • Loading branch information...
WangNingkai committed Jun 15, 2019
1 parent 5fab430 commit fec74e9996605c6cd38cad4992a9175d7aadc875
Showing with 14 additions and 9 deletions.
  1. +8 −0 app/Http/Controllers/IndexController.php
  2. +1 −1 app/Utils/Tool.php
  3. +5 −8 routes/web.php
@@ -409,6 +409,10 @@ public function thumbCrop($id, $width, $height): RedirectResponse
*/
public function search(Request $request)
{
if (!setting('open_search', 0)) {
Tool::showMessage('搜索暂不可用', false);
return view(config('olaindex.theme') . 'message');
}
$keywords = $request->get('keywords');
$limit = $request->get('limit', 20);
if ($keywords) {
@@ -440,6 +444,10 @@ public function search(Request $request)
*/
public function searchShow($id): RedirectResponse
{
if (!setting('open_search', 0)) {
Tool::showMessage('搜索暂不可用', false);
return view(config('olaindex.theme') . 'message');
}
$response = OneDrive::getInstance(one_account())->itemIdToPath($id, setting('root'));
if ($response['errno'] === 0) {
$originPath = $response['data']['path'];
@@ -342,7 +342,7 @@ public static function getFileContent($url, $cache = '')
{
if ($cache) {
$key = 'one:content:' . $cache;
$content = Cache::get($key,'');
$content = Cache::get($key, '');
if ($content) {
return $content;
}
@@ -11,13 +11,10 @@
Route::get('thumb/{id}/{width}/{height}', 'IndexController@thumbCrop')->name('thumb_crop');
// 搜索
if (setting('open_search',0)) {
Route::any('search', 'IndexController@search')
->name('search');
Route::any('search/file/{id}', 'IndexController@searchShow')
->name('search.show');
}
Route::any('search', 'IndexController@search')
->name('search');
Route::any('search/file/{id}', 'IndexController@searchShow')
->name('search.show');
// 加密
@@ -90,7 +87,7 @@
if (Str::contains(config('app.url'), ['localhost', 'dev.ningkai.wang'])) {
Route::get('about', static function () {
$url = 'https://raw.githubusercontent.com/WangNingkai/OLAINDEX/master/README.md';
$content = Tool::getFileContent($url,'aboutMe');
$content = Tool::getFileContent($url, 'aboutMe');
$markdown = Tool::markdown2Html($content);
return response()->view(

0 comments on commit fec74e9

Please sign in to comment.
You can’t perform that action at this time.