Index.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. namespace app\index\controller;
  3. use app\common\controller\Frontend;
  4. use think\Db;
  5. class Index extends Frontend
  6. {
  7. protected $noNeedLogin = '*';
  8. protected $noNeedRight = '*';
  9. protected $layout = '';
  10. public function index()
  11. {
  12. exit;
  13. return $this->view->fetch();
  14. }
  15. /**
  16. * app下载页
  17. * 判断是安卓还是ios
  18. */
  19. public function appdownload() {
  20. $this->view->assign('downurl', config("site.apkurl"));
  21. return $this->view->fetch();
  22. if(strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone')||strpos($_SERVER['HTTP_USER_AGENT'], 'iPad')){
  23. header("Location: https://apps.apple.com/cn/app/%E4%BC%B4%E5%A3%B0%E8%AF%AD%E9%9F%B3/id1556551099");
  24. }else if(strpos($_SERVER['HTTP_USER_AGENT'], 'Android')){
  25. //$host = $_SERVER["REQUEST_SCHEME"]."://".$_SERVER["HTTP_HOST"];
  26. //header("Location: ".$host."/index/index/download");
  27. $this->view->assign('downurl', config("site.apkurl"));
  28. return $this->view->fetch();
  29. }else{
  30. $this->view->assign('downurl', config("site.apkurl"));
  31. return $this->view->fetch();
  32. }
  33. }
  34. //基础文章网页
  35. public function basedata(){
  36. $key = input('key','');
  37. if(!$key){
  38. exit;
  39. }
  40. $content = Db::name('basedata')->where('key',$key)->find();
  41. $this->assign('content',$content['content']);
  42. return $this->fetch();
  43. }
  44. }