HomeController.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. namespace App\Http\Controllers;
  3. use Illuminate\Http\Request;
  4. use Illuminate\Support\Facades\Gate;
  5. class HomeController extends Controller
  6. {
  7. /**
  8. * Create a new controller instance.
  9. *
  10. * @return void
  11. */
  12. public function __construct()
  13. {
  14. $this->middleware('auth');
  15. }
  16. /**
  17. * Show the application dashboard.
  18. *
  19. * @return \Illuminate\Contracts\Support\Renderable
  20. */
  21. public function index()
  22. {
  23. if(!Gate::allows('退货管理-查询')){
  24. if(!Gate::allows('运输管理-运单-查询')){ return view('home');}
  25. return view("home");
  26. }
  27. return redirect(url('rejected/index/general'));
  28. }
  29. public function home()
  30. {
  31. return view('home');
  32. }
  33. public function help()
  34. {
  35. $filePath = base_path('文档/SystemHandBook.md');
  36. $read = @file_get_contents($filePath);
  37. $read = str_replace(["\r","\n",'"'],["\\r",'\\n',"'"],$read);
  38. return view("help",compact("read"));
  39. }
  40. }