Files
amb_wechatapp/application/pc/controller/Index.php
T

65 lines
1.6 KiB
PHP

<?php
namespace app\pc\controller;
use app\common\controller\Frontend;
class Index extends Frontend
{
protected $noNeedLogin = ['*'];
protected $noNeedRight = '*';
protected $layout = '';
public function index()
{
$config = \app\common\model\config\System::getConfig('system');
if(isset($config['mobile_pc_route']) && $config['mobile_pc_route'] == 'open'){
//判断当前是PC还是移动端
if(isMobile()){
//thinkphp5重定向
$this->redirect(request()->domain().'/index.php?i='.UNIACID.'&route=index#/');
exit;
}
}
global $_W,$_GPC;
$SCHEME = 'http';
if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on'){
$SCHEME = 'https';
}
if(isset($SCHEME['REQUEST_SCHEME'])){
$SCHEME = $SCHEME['REQUEST_SCHEME'];
}
$url = $SCHEME."://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
$config = \app\common\model\app\Config::getConfig("pc_pc");
if(!isset($config['x_icon'])){
$config['x_icon'] = '';
}
if(!isset($config['status'])){
$config['status'] = 1;
}
if(!$config['status']){
return $this->view->fetch('close');
}
$meta = (new \app\api\model\app\pc\Seo())->getMeta();
$this->view->assign('url', $url);
$this->view->assign('gpc', $_GPC);
$this->view->assign('pc_config', $config);
$this->view->assign('w', $_W);
$this->view->assign('meta', $meta);
return $this->view->fetch();
}
}