Index.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. public function wxsharedownload(){
  16. $this->view->assign('downurl', config("site.apkurl"));
  17. return $this->view->fetch();
  18. }
  19. /**
  20. * app下载页
  21. * 判断是安卓还是ios
  22. */
  23. public function appdownload() {
  24. $this->view->assign('downurl', config("site.apkurl"));
  25. return $this->view->fetch();
  26. if(strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone')||strpos($_SERVER['HTTP_USER_AGENT'], 'iPad')){
  27. header("Location: https://apps.apple.com/cn/app/%E4%BC%B4%E5%A3%B0%E8%AF%AD%E9%9F%B3/id1556551099");
  28. }else if(strpos($_SERVER['HTTP_USER_AGENT'], 'Android')){
  29. //$host = $_SERVER["REQUEST_SCHEME"]."://".$_SERVER["HTTP_HOST"];
  30. //header("Location: ".$host."/index/index/download");
  31. $this->view->assign('downurl', config("site.apkurl"));
  32. return $this->view->fetch();
  33. }else{
  34. $this->view->assign('downurl', config("site.apkurl"));
  35. return $this->view->fetch();
  36. }
  37. }
  38. //基础文章网页
  39. public function basedata(){
  40. $key = input('key','');
  41. if(!$key){
  42. exit;
  43. }
  44. $content = Db::name('basedata')->where('key',$key)->find();
  45. $this->assign('content',$content['content']);
  46. return $this->fetch();
  47. }
  48. }