Index.php 782 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /**
  3. *
  4. * @copyright ©2020 点小铺
  5. * @author hanj
  6. * @link: https://dyuit.com
  7. * Created by VSCode
  8. */
  9. namespace app\store\controller;
  10. use app\store\model\Store as StoreModel;
  11. /**
  12. * 后台首页
  13. * Class Index
  14. * @package app\store\controller
  15. */
  16. class Index extends Controller
  17. {
  18. /**
  19. * 后台首页
  20. * @return mixed
  21. * @throws \think\Exception
  22. * @throws \think\exception\DbException
  23. */
  24. public function index()
  25. {
  26. // 当前用户菜单url
  27. $menus = $this->menus();
  28. $url = current(array_values($menus))['index'];
  29. if ($url !== 'index/index') {
  30. $this->redirect($url);
  31. }
  32. $model = new StoreModel;
  33. return $this->fetch('index', ['data' => $model->getHomeData()]);
  34. }
  35. }