Index.php 959 B

1234567891011121314151617181920212223242526272829303132
  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. View::assign("version", app_version);
  19. View::assign("customHead",SettingModel::Config('customHead',''));
  20. return View::fetch("dist/index.html");
  21. }
  22. function favicon(): \think\response\File
  23. {
  24. //从配置中获取logo
  25. $favicon = $this->Setting('logo');
  26. return download(public_path() . $favicon);
  27. }
  28. }