redirect(request()->domain().'/index.php?i='.UNIACID.'&route=pc#/page/index'); exit; } } if($config['status'] == 'close'){ return $this->errorPage('店铺暂不可用,请稍后再试'); } if(isWeixin()){ $wxOfficialAccountConfig = \app\common\model\config\System::getConfig('wxOfficialAccount'); if(isset($wxOfficialAccountConfig['status']) && $wxOfficialAccountConfig['status'] != 'open'){ return $this->errorPage('该终端暂不可用'); } }else{ $h5Config = \app\common\model\config\System::getConfig('H5'); if(isset($h5Config['status']) && $h5Config['status'] != 'open'){ return $this->errorPage('该终端暂不可用'); } } $this->view->assign('config',$this->getPageConfig()); return $this->view->fetch(); } /** * 获取配置 * @return false|string */ public function getPageConfig(){ global $_W,$_GPC; if(\app\common\library\Platform::getSystemType() == 'single'){ $data['apiUrl'] = $_W['siteroot'].'/index.php?i='.$_W['uniacid'].'&route=api/'; }else{ $data['apiUrl'] = $_W['siteroot'].'/app/index.php?i='.$_W['uniacid'].'&c=entry&m=tuzi_v1&do=index&route=api/'; } return json_encode($data); } /** * 错误页面 * @param $message * @return mixed */ public function errorPage($message){ $this->view->assign('message',$message); return $this->view->fetch('error_page'); } public function exportConfig(){ (new \app\common\model\fill\Handle())->export('config_system'); } }