Index.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. namespace app\index\controller;
  3. use think\Controller;
  4. use think\Db;
  5. class Index extends Controller
  6. {
  7. protected $noNeedLogin = '*';
  8. protected $noNeedRight = '*';
  9. protected $layout = '';
  10. public function index()
  11. {
  12. return $this->view->fetch();
  13. }
  14. /**
  15. * app下载页
  16. * 判断是安卓还是ios
  17. */
  18. public function appdownload() {
  19. if(strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone')||strpos($_SERVER['HTTP_USER_AGENT'], 'iPad')){
  20. header("Location: ".config('site.user_ios_download_url'));
  21. }else if(strpos($_SERVER['HTTP_USER_AGENT'], 'Android')){
  22. $this->view->assign('downurl', config("site.user_android_download_url"));
  23. return $this->view->fetch();
  24. }else{
  25. $this->view->assign('downurl', config("site.user_android_download_url"));
  26. return $this->view->fetch();
  27. }
  28. }
  29. //基础文章网页
  30. public function basedata(){
  31. $key = input('key','');
  32. if(!$key){
  33. exit;
  34. }
  35. $content = Db::name('basedata')->where('key',$key)->find();
  36. $this->assign('content',$content['content']);
  37. return $this->fetch();
  38. }
  39. }