初始化项目:添加后端代码、ThinkPHP框架、前端资源
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
<?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();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user