Index.php 884 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. namespace app\home\controller;
  3. use think\Lang;
  4. use think\Cache;
  5. use think\Request;
  6. use think\Controller;
  7. use think\Validate;
  8. /**
  9. * 主页管理类
  10. */
  11. class Index extends Common
  12. {
  13. /**
  14. * 构造函数
  15. *
  16. * @access public
  17. */
  18. public function __construct()
  19. {
  20. parent::__construct();
  21. }// end__construct()
  22. /**
  23. * 主页管理
  24. *
  25. * @access public
  26. * @return array JsonString
  27. */
  28. public function index()
  29. {
  30. $getHomeInformation = model('homeinformation')->getHomeInformation();
  31. $this->assign('information', $getHomeInformation);
  32. return $this->fetch();
  33. }
  34. public function isLogin()
  35. {
  36. $userId = session('user_id');
  37. if ($userId) {
  38. return ["success"=>true];
  39. } else {
  40. return ["success"=>false];
  41. }
  42. }//end index()
  43. }