Index.php 895 B

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