Index.php 830 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace app\controller;
  3. use app\BaseController;
  4. use app\model\SettingModel;
  5. use GuzzleHttp\Exception\GuzzleException;
  6. use think\exception\ErrorException;
  7. use think\facade\Cache;
  8. use think\facade\View;
  9. use think\Request;
  10. class Index extends BaseController
  11. {
  12. function index(Request $request, $s = ''): string
  13. {
  14. $title = SettingModel::Config('title','Mtab书签');
  15. View::assign("title",$title);
  16. View::assign("keywords",SettingModel::Config('keywords','Mtab书签'));
  17. View::assign("description",SettingModel::Config('description','Mtab书签'));
  18. return View::fetch("dist/index.html");
  19. }
  20. function favicon(): \think\response\File
  21. {
  22. //从配置中获取logo
  23. $favicon = $this->Setting('logo');
  24. return download(public_path() . $favicon);
  25. }
  26. }