初始化项目:添加后端代码、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();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport"
|
||||
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>抱歉,PC端暂不可用</title>
|
||||
<style>
|
||||
html,body,div,h1,*{margin:0;padding:0;}
|
||||
body{
|
||||
background-color:#fefefe;
|
||||
color:#333
|
||||
}
|
||||
.box{
|
||||
margin:0 auto;
|
||||
margin-top:10%;
|
||||
padding-top:160px;
|
||||
text-align: center;
|
||||
}
|
||||
h1{
|
||||
font-size:16px;
|
||||
text-align:center;
|
||||
font-weight:normal;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="box">
|
||||
<img src="/assets/image/close.png" alt="" width="100">
|
||||
<h1>抱歉!PC端暂不可用,请移步其他终端学习!</h1>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,39 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>{$meta.title}</title>
|
||||
<meta name="keywords" content="{$meta.keywords}">
|
||||
<meta name="description" content="{$meta.description}">
|
||||
<link rel='icon' href='{$pc_config.x_icon}' type='image/x-ico'/>
|
||||
<script>
|
||||
var apiServerPath = '{$w.siteroot}';
|
||||
var linkConfig = {
|
||||
c : "{$gpc.c}",
|
||||
a : "{$gpc.a}",
|
||||
w7i : "{$gpc.w7i}",
|
||||
eid : "{$gpc.eid}",
|
||||
version_id : "{$gpc.version_id}"
|
||||
}
|
||||
|
||||
var projectType = 'single';
|
||||
|
||||
var mobilePath = '{$w.siteroot}?i={$w.uniacid}';
|
||||
</script>
|
||||
<!-- pc start -->
|
||||
<script type="module" crossorigin src="/assets/pc/index.f9a502e2.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="/assets/pc/arco.c6cced51.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/pc/chart.e0a67bf9.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/pc/vue.6689c566.js">
|
||||
<link rel="stylesheet" href="/assets/pc/index.d1eab22d.css">
|
||||
<!-- pc end -->
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="app"></div>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user