Skip to content

Commit

Permalink
fix 预定义文件显示问题
Browse files Browse the repository at this point in the history
  • Loading branch information
WangNingkai committed Nov 6, 2018
1 parent c4e230f commit 7aa7a52
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
14 changes: 0 additions & 14 deletions app/Helpers/Tool.php
Original file line number Diff line number Diff line change
Expand Up @@ -338,20 +338,6 @@ public static function filterFolder($items)
return $items;
}

/**
* 过滤指定文件
* @param $items
* @param $itemName
* @return mixed
*/
public static function filterFiles($items, $itemName)
{
if (is_array($itemName)) {
array_except($items, $itemName);
} else unset($items[$itemName]);
return $items;
}

/**
* 过滤禁用目录
* @param $items
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/IndexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public function list(Request $request)
$head = array_key_exists('HEAD.md', $origin_items) ? Tool::markdown2Html(Tool::getFileContent($origin_items['HEAD.md']['@microsoft.graph.downloadUrl'])) : '';
$readme = array_key_exists('README.md', $origin_items) ? Tool::markdown2Html(Tool::getFileContent($origin_items['README.md']['@microsoft.graph.downloadUrl'])) : '';
$path_array = $origin_path ? explode('/', $origin_path) : [];
if (!session()->has('LogInfo')) $origin_items = Tool::filterFiles($origin_items, ['README.md', 'HEAD.md', '.password', '.deny']);
if (!session()->has('LogInfo')) $origin_items = array_except($origin_items, ['README.md', 'HEAD.md', '.password', '.deny']);
$items = Tool::paginate($origin_items, 20);
return view('one', compact('items', 'origin_items', 'origin_path', 'path_array', 'head', 'readme', 'hasImage'));
}
Expand Down

0 comments on commit 7aa7a52

Please sign in to comment.