isAjax()){ $config=is_array($config)?null:$config; return view($template, $vars, $replace,$config); }else{ return parent::fetch($template, $vars, $replace, $config); } } /*输出内容函数*/ private static $echo_msg_head=null; public function echo_msg($str,$color='red',$echo=true,$end_str=''){ if(defined('CLOSE_ECHO_MSG')){ $echo=false; } if($echo){ if(!isset(self::$echo_msg_head)){ self::$echo_msg_head=true; header('Content-type: text/html; charset=utf-8'); header('X-Accel-Buffering: no'); @ini_set('output_buffering','Off'); ob_end_clean(); @ob_implicit_flush(1); $outputSize=ini_get('output_buffering'); $outputSize=intval($outputSize); if(preg_match('/\biis\b/i', $_SERVER["SERVER_SOFTWARE"])){ if($outputSize<1024*1024*4){ $outputSize=1024*1024*4; echo ''; } } echo ''; $allowOutput=false; if($outputSize>1024*1024){ $mobileDetect=new \util\MobileDetect(); if(!$mobileDetect->isMobile()){ $allowOutput=true; } }else{ $allowOutput=true; } if($allowOutput){ echo str_pad(' ', $outputSize>1050?($outputSize+100):1050); } } echo '

'.$str.'

'.$end_str; if(ob_get_level()>0){ ob_flush(); flush(); } } } /*保留旧的入口*/ public function indexAction(){ if(strtolower(request()->controller())=='base'){ $this->redirect('Admin/Backstage/index'); } } }