Begin.php 669 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace app\common\behavior;
  3. class Begin
  4. {
  5. public function run(&$params)
  6. {
  7. $module = '';
  8. $dispatch = request()->dispatch();
  9. if (isset($dispatch['module'])) {
  10. $module = $dispatch['module'][0];
  11. }
  12. if( $module =='install'){
  13. return;
  14. }
  15. if(defined('ENTRANCE') && ENTRANCE == 'admin') {
  16. if ($module == '') {
  17. header('Location: '.url('admin/index/index'));
  18. exit;
  19. }
  20. if ($module != 'admin' ) {
  21. header('Location: '.url('admin/index/index'));
  22. exit;
  23. }
  24. }
  25. }
  26. }