You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

HomeController.php 1.8 KiB

3 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. /**
  3. *
  4. * ============================================================================
  5. * * 版权所有 蜘蛛出行 * *
  6. * 网站地址: http://www.zhizhuchuxing.com
  7. * ----------------------------------------------------------------------------
  8. * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
  9. * 使用;不允许对程序代码以任何形式任何目的的再发布。
  10. * ============================================================================
  11. * Author By: 倪宗锋
  12. * PhpStorm HomeController.php
  13. * Create By 2016/11/5 16:05 $
  14. */
  15. namespace Home\Controller;
  16. use Home\Service\HomeService;
  17. use Util\Controller\MvcController;
  18. use Util\Util\BrowserCache;
  19. use Util\Util\Util;
  20. class HomeController extends MvcController
  21. {
  22. private $service;
  23. public function __construct()
  24. {
  25. parent::__construct();
  26. $this->service = new HomeService();
  27. }
  28. /**
  29. * Function Description:网站首页
  30. * Function Name: indexAction
  31. *
  32. * @return string|void
  33. *
  34. * @author 倪宗锋
  35. */
  36. public function indexAction()
  37. {
  38. $isCache = BrowserCache::checkCache();//校验浏览器缓存是否过时
  39. if ($isCache['flag'] == false) {
  40. return '';
  41. }
  42. $getInfo = $this->service->getHomeInfo();
  43. if ($getInfo['flag'] == false) {
  44. return $this->viewError($getInfo['msg']);
  45. } else {
  46. $info = $getInfo['data'];
  47. }
  48. $_SESSION['test'] = true;
  49. $this->setViewParam('info', $info);
  50. return $this->viewModel('index');
  51. }
  52. /**
  53. * Function Description:调试方法
  54. * Function Name: zzAction
  55. *
  56. * @return string
  57. *
  58. * @author 倪宗锋
  59. */
  60. public function zzAction()
  61. {
  62. return Util::returnJsSu('zz调试');
  63. }
  64. }