增加默认错误页面
This commit is contained in:
@@ -1,19 +1,35 @@
|
||||
<?php
|
||||
namespace catchAdmin\index\controller;
|
||||
|
||||
use catchAdmin\permissions\model\Permissions;
|
||||
use catchAdmin\user\Auth;
|
||||
use catcher\base\CatchController;
|
||||
use catcher\Tree;
|
||||
use think\facade\Db;
|
||||
|
||||
class Index extends CatchController
|
||||
{
|
||||
/**
|
||||
*
|
||||
* @time 2019年12月11日
|
||||
* @throws \Exception
|
||||
* @return string
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
*/
|
||||
public function index(): string
|
||||
{
|
||||
return $this->fetch();
|
||||
$permissionIds = Auth::user()->getPermissionsBy();
|
||||
|
||||
$menus = Permissions::whereIn('id', $permissionIds)
|
||||
->where('type', Permissions::MENU_TYPE)
|
||||
->field(['id', 'parent_id', 'permission_name', 'route'])
|
||||
->select()->toArray();
|
||||
|
||||
return $this->fetch([
|
||||
'menus' => Tree::done($menus),
|
||||
'username' => Auth::user()->username,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -26,4 +42,18 @@ class Index extends CatchController
|
||||
{
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @time 2019年12月12日
|
||||
* @throws \Exception
|
||||
* @return string
|
||||
*/
|
||||
public function dashboard(): string
|
||||
{
|
||||
$mysqlVersion = Db::query('select version() as version');
|
||||
return $this->fetch([
|
||||
'mysql_version' => $mysqlVersion['0']['version'],
|
||||
]);
|
||||
}
|
||||
}
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
$router->get('/', '\catchAdmin\index\controller\index/index');
|
||||
$router->get('theme', '\catchAdmin\index\controller\index/theme');
|
||||
$router->get('/', '\catchAdmin\index\controller\index@index');
|
||||
$router->get('theme', '\catchAdmin\index\controller\index@theme');
|
||||
$router->get('dashboard', '\catchAdmin\index\controller\index@dashboard');
|
||||
|
@@ -1,10 +1,221 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
<meta charset="utf-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<title>CatchAdmin 后台开发框架</title>
|
||||
<link rel="stylesheet" href="__CATCH_ADMIN_LIBS__/layui/css/layui.css"/>
|
||||
<link rel="stylesheet" href="__CATCH_ADMIN_MODULE__/admin.css?v=315"/>
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
<style>
|
||||
/** 卡片轮播图样式 */
|
||||
.admin-carousel .layui-carousel-ind {
|
||||
position: absolute;
|
||||
top: -41px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.admin-carousel .layui-carousel-ind ul {
|
||||
background: 0 0;
|
||||
}
|
||||
|
||||
.admin-carousel .layui-carousel-ind li {
|
||||
background-color: #e2e2e2;
|
||||
}
|
||||
|
||||
.admin-carousel .layui-carousel-ind li.layui-this {
|
||||
background-color: #999;
|
||||
}
|
||||
|
||||
/** 广告位轮播图 */
|
||||
.admin-news .layui-carousel-ind {
|
||||
height: 45px;
|
||||
}
|
||||
|
||||
.admin-news a {
|
||||
display: block;
|
||||
line-height: 60px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<!-- 加载动画 -->
|
||||
<div class="page-loading">
|
||||
<div class="ball-loader">
|
||||
<span></span><span></span><span></span><span></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 正文开始 -->
|
||||
<div class="layui-fluid">
|
||||
<div class="layui-row layui-col-space15">
|
||||
<div class="layui-col-xs12 layui-col-sm6 layui-col-md3">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">
|
||||
访问量<span class="layui-badge layui-bg-blue pull-right">周</span>
|
||||
</div>
|
||||
<div class="layui-card-body">
|
||||
<p class="lay-big-font">99,666</p>
|
||||
<p>总计访问量<span class="pull-right">88万 <i class="layui-icon layui-icon-flag"></i></span></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-xs12 layui-col-sm6 layui-col-md3">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">
|
||||
下载<span class="layui-badge layui-bg-black pull-right">月</span>
|
||||
</div>
|
||||
<div class="layui-card-body">
|
||||
<p class="lay-big-font">33,555</p>
|
||||
<p>新下载<span class="pull-right">10% <i class="layui-icon"></i></span></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-xs12 layui-col-sm6 layui-col-md3">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">
|
||||
Start<span class="layui-badge layui-bg-green pull-right">周</span>
|
||||
</div>
|
||||
<div class="layui-card-body">
|
||||
<p class="lay-big-font">99,666</p>
|
||||
<p>总Start数<span class="pull-right">88万 <i class="layui-icon layui-icon-rate"></i></span></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-xs12 layui-col-sm6 layui-col-md3">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">
|
||||
活跃用户<span class="layui-badge layui-bg-orange pull-right">月</span>
|
||||
</div>
|
||||
<div class="layui-card-body">
|
||||
<p class="lay-big-font">66,666</p>
|
||||
<p>最近一个月<span class="pull-right">15% <i class="layui-icon layui-icon-user"></i></span></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-row layui-col-space15">
|
||||
<div class="layui-col-lg8 layui-col-md7">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">更新日志</div>
|
||||
<div class="layui-card-body">
|
||||
<ul class="layui-timeline">
|
||||
<li class="layui-timeline-item">
|
||||
<i class="layui-icon layui-timeline-axis"></i>
|
||||
<div class="layui-timeline-content layui-text">
|
||||
<h3 class="layui-timeline-title">
|
||||
V1.0
|
||||
<small>catchAdmin 后台框架</small> 
|
||||
<span class="layui-badge-rim">2019-11-14</span>
|
||||
</h3>
|
||||
<ul>
|
||||
<li>基于 Thinkphp6 & layui 开发</li>
|
||||
<li>完整的权限管理</li>
|
||||
<li>模块化开发方式</li>
|
||||
<li>...</li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
<li class="layui-timeline-item">
|
||||
<i class="layui-icon layui-timeline-axis"></i>
|
||||
<div class="layui-timeline-content layui-text">
|
||||
<div class="layui-timeline-title">
|
||||
CatchAdmin 开发中... <span class="layui-badge-rim">更早</span>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-lg4 layui-col-md5">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">后台框架</div>
|
||||
<div class="layui-card-body">
|
||||
<table class="layui-table layui-text">
|
||||
<colgroup>
|
||||
<col width="100">
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>PHP 版本</td>
|
||||
<td>{$Think.PHP_VERSION}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>MYSQL 版本</td>
|
||||
<td>{$mysql_version}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>WEB 服务器</td>
|
||||
<td>{$_SERVER['SERVER_SOFTWARE']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>操作系统</td>
|
||||
<td>{$Think.PHP_OS}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>opcache (建议开启)</td>
|
||||
{if condition="function_exists('opcache_get_configuration')"}
|
||||
<td>{:opcache_get_configuration()['directives']['opcache.enable'] ? '开启' : '关闭' }</td>
|
||||
{else/}
|
||||
<td>未开启</td>
|
||||
{/if}
|
||||
</tr>
|
||||
<tr>
|
||||
<td>最大执行时间</td>
|
||||
<td>{:get_cfg_var("max_execution_time")} s</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>上传限制大小(M)</td>
|
||||
<td>{:get_cfg_var ("upload_max_filesize")}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>当前时间</td>
|
||||
<td>{:date("Y-m-d H:i:s")}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>核心框架</td>
|
||||
<td>Thinkphp v6</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- js部分 -->
|
||||
<script type="text/javascript" src="__CATCH_ADMIN_LIBS__/layui/layui.js"></script>
|
||||
<script type="text/javascript" src="__CATCH_ADMIN_JS__/common.js?v=315"></script>
|
||||
<script>
|
||||
layui.use(['layer', 'carousel'], function () {
|
||||
var $ = layui.jquery;
|
||||
var layer = layui.layer;
|
||||
var carousel = layui.carousel;
|
||||
var device = layui.device;
|
||||
|
||||
// 渲染轮播
|
||||
carousel.render({
|
||||
elem: '.layui-carousel',
|
||||
width: '100%',
|
||||
height: '60px',
|
||||
arrow: 'none',
|
||||
autoplay: true,
|
||||
trigger: device.ios || device.android ? 'click' : 'hover',
|
||||
anim: 'fade'
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
@@ -15,19 +15,12 @@
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!-- 加载动画 -->
|
||||
<div class="page-loading">
|
||||
<div class="ball-loader">
|
||||
<span></span><span></span><span></span><span></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 正文开始 -->
|
||||
<div class="error-page">
|
||||
<img class="error-page-img" src="__CATCH_ADMIN_IMAGES__/ic_403.png">
|
||||
<div class="error-page-info">
|
||||
<h1>403</h1>
|
||||
<div class="error-page-info-desc">抱歉,你无权访问此页面</div>
|
||||
<div class="error-page-info-desc">{$msg}</div>
|
||||
<div>
|
||||
<button ew-href="/" class="layui-btn">返回首页</button>
|
||||
</div>
|
||||
@@ -37,12 +30,5 @@
|
||||
<!-- js部分 -->
|
||||
<script type="text/javascript" src="__CATCH_ADMIN_LIBS__/layui/layui.js"></script>
|
||||
<script type="text/javascript" src="__CATCH_ADMIN_JS__/common.js?v=315"></script>
|
||||
<script>
|
||||
layui.use(['admin'], function () {
|
||||
var $ = layui.jquery;
|
||||
var admin = layui.admin;
|
||||
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@@ -45,7 +45,7 @@
|
||||
<li class="layui-nav-item" lay-unselect>
|
||||
<a>
|
||||
<img src="__CATCH_ADMIN_IMAGES__/head.png" class="layui-nav-img">
|
||||
<cite>管理员</cite>
|
||||
<cite>{$username}</cite>
|
||||
</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd lay-unselect>
|
||||
@@ -56,7 +56,7 @@
|
||||
</dd>
|
||||
<hr>
|
||||
<dd lay-unselect>
|
||||
<a ew-event="logout" data-url="page/template/login.html">退出</a>
|
||||
<a ew-event="logout" data-url="{:url('logout')}">退出</a>
|
||||
</dd>
|
||||
</dl>
|
||||
</li>
|
||||
@@ -71,147 +71,20 @@
|
||||
<div class="layui-side-scroll">
|
||||
<ul class="layui-nav layui-nav-tree arrow2" lay-filter="admin-side-nav" lay-accordion="true"
|
||||
style="margin-top: 15px;">
|
||||
{foreach $menus as $key => $menu }
|
||||
<li class="layui-nav-item">
|
||||
<a><i class="layui-icon layui-icon-home"></i> <cite>Dashboard</cite></a>
|
||||
{if (!empty($menu['children']))}
|
||||
<a><i class="layui-icon layui-icon-home"></i> <cite>{$menu['permission_name']}</cite></a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd><a lay-href="page/console/console.html">控制台</a></dd>
|
||||
<dd><a lay-href="page/console/introduction.html">介绍页</a></dd>
|
||||
<dd><a lay-href="page/console/dashboard.html">分析页</a></dd>
|
||||
<dd><a lay-href="page/console/welcome.html">欢迎页</a></dd>
|
||||
{foreach $menu['children'] as $m}
|
||||
<dd><a lay-href="{:url($m['route'])}">{$m['permission_name']}</a></dd>
|
||||
{/foreach}
|
||||
</dl>
|
||||
{else/}
|
||||
<a lay-href="{:url($menu['route'])}"><i class="layui-icon layui-icon-unlink"></i> <cite>{$menu['permission_name']}</cite></a>
|
||||
{/if}
|
||||
</li>
|
||||
<li class="layui-nav-item">
|
||||
<a><i class="layui-icon layui-icon-set"></i> <cite>权限管理</cite></a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd><a lay-href="{:url('user')}">用户管理</a></dd>
|
||||
<dd><a lay-href="{:url('role')}">角色管理</a></dd>
|
||||
<dd><a lay-href="{:url('permission')}">菜单管理</a></dd>
|
||||
<dd><a lay-href="page/system/loginRecord.html">登录日志</a></dd>
|
||||
</dl>
|
||||
</li>
|
||||
<li class="layui-nav-item">
|
||||
<a><i class="layui-icon layui-icon-template"></i> <cite>模板页面</cite></a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd>
|
||||
<a>表单页</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd><a lay-href="page/template/form/form-basic.html">基础表单</a></dd>
|
||||
<dd><a lay-href="page/template/form/form-advance.html">复杂表单</a></dd>
|
||||
<dd><a lay-href="page/template/form/form-step.html">分步表单</a></dd>
|
||||
</dl>
|
||||
</dd>
|
||||
<dd>
|
||||
<a>表格页</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd><a lay-href="page/template/table/table-basic.html">数据表格</a></dd>
|
||||
<dd><a lay-href="page/template/table/table-advance.html">复杂查询</a></dd>
|
||||
<dd><a lay-href="page/template/table/table-ltrt.html">左树右表</a></dd>
|
||||
<dd><a lay-href="page/template/table/table-img.html">表格缩略图</a></dd>
|
||||
</dl>
|
||||
</dd>
|
||||
<dd>
|
||||
<a>错误页</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd><a lay-href="page/template/error/error-500.html">500</a></dd>
|
||||
<dd><a lay-href="page/template/error/error-404.html">404</a></dd>
|
||||
<dd><a lay-href="page/template/error/error-403.html">403</a></dd>
|
||||
</dl>
|
||||
</dd>
|
||||
<dd><a lay-href="page/template/user-info.html">个人中心</a></dd>
|
||||
<dd><a lay-href="page/template/empty.html">空白页面</a></dd>
|
||||
<dd><a href="page/template/login.html" target="_blank">登录页面</a></dd>
|
||||
</dl>
|
||||
</li>
|
||||
<li class="layui-nav-item">
|
||||
<a><i class="layui-icon layui-icon-component"></i> <cite>扩展组件</cite></a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd>
|
||||
<a>常用组件</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd><a lay-href="page/plugin/basic/dialog.html">弹出层</a></dd>
|
||||
<dd><a lay-href="page/plugin/basic/dropdown.html">下拉菜单</a></dd>
|
||||
<dd><a lay-href="page/plugin/basic/cascader.html">级联选择器</a></dd>
|
||||
<dd><a lay-href="page/plugin/basic/notice.html">消息通知</a></dd>
|
||||
<dd><a lay-href="page/plugin/basic/tips.html">文字提示</a></dd>
|
||||
<dd><a lay-href="page/plugin/basic/tagsInput.html">标签输入</a></dd>
|
||||
<dd><a lay-href="page/plugin/basic/split.html">分割面板</a></dd>
|
||||
<dd><a lay-href="page/plugin/basic/circleProgress.html">圆形进度条</a></dd>
|
||||
</dl>
|
||||
</dd>
|
||||
<dd>
|
||||
<a>进阶组件</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd><a lay-href="page/plugin/advance/tableX.html">表格扩展</a></dd>
|
||||
<dd><a lay-href="page/plugin/advance/formX.html">表单扩展</a></dd>
|
||||
<dd><a lay-href="page/plugin/advance/dataGrid.html">数据列表</a></dd>
|
||||
<dd><a lay-href="page/plugin/advance/printer.html">打印插件</a></dd>
|
||||
<dd><a lay-href="page/plugin/advance/ckeditor.html">富文本编辑</a></dd>
|
||||
<dd><a lay-href="page/plugin/advance/player.html">视频播放器</a></dd>
|
||||
<dd><a lay-href="page/plugin/advance/introJs.html">引导插件</a></dd>
|
||||
</dl>
|
||||
</dd>
|
||||
<dd>
|
||||
<a>工具组件</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd><a lay-href="page/plugin/util/contextMenu.html">ContextMenu</a></dd>
|
||||
<dd><a lay-href="page/plugin/util/mousewheel.html">MouseWheel</a></dd>
|
||||
<dd><a lay-href="page/plugin/util/other.html">其他</a></dd>
|
||||
</dl>
|
||||
</dd>
|
||||
<dd><a lay-href="page/plugin/more.html">更多扩展</a></dd>
|
||||
</dl>
|
||||
</li>
|
||||
<li class="layui-nav-item">
|
||||
<a><i class="layui-icon layui-icon-app"></i> <cite>经典实例</cite></a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd><a lay-href="page/example/dialog.html">弹窗实例</a></dd>
|
||||
<dd><a lay-href="page/example/syxm.html">经典实例2</a></dd>
|
||||
<dd><a lay-href="page/example/form.html">表单实例</a></dd>
|
||||
<dd><a lay-href="page/example/file.html">文件管理</a></dd>
|
||||
<dd><a lay-href="page/example/table-crud.html">表格CRUD</a></dd>
|
||||
<dd><a href="page/example/side-more.html" target="_blank">多系统模式</a></dd>
|
||||
<dd><a href="page/example/side-ajax.html" target="_blank">Ajax侧边栏</a></dd>
|
||||
</dl>
|
||||
</li>
|
||||
<li class="layui-nav-item">
|
||||
<a><i class="layui-icon layui-icon-release"></i> <cite>LayUI组件</cite></a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd><a lay-href="https://www.layui.com/demo/button.html">组件演示</a></dd>
|
||||
<dd><a lay-href="https://www.layui.com/doc/element/button.html#use">layui文档</a></dd>
|
||||
<dd><a lay-href="https://layer.layui.com/">layer弹窗组件</a></dd>
|
||||
<dd><a lay-href="https://www.layui.com/laydate/">laydate日期组件</a></dd>
|
||||
</dl>
|
||||
</li>
|
||||
<li class="layui-nav-item">
|
||||
<a><i class="layui-icon layui-icon-unlink"></i> <cite>多级菜单</cite></a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd><a>二级菜单</a></dd>
|
||||
<dd>
|
||||
<a>二级菜单</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd><a>三级菜单</a></dd>
|
||||
<dd>
|
||||
<a>三级菜单</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd><a>四级菜单</a></dd>
|
||||
<dd>
|
||||
<a>四级菜单</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd><a>五级菜单</a></dd>
|
||||
<dd>
|
||||
<a lay-href="https://baidu.com">百度一下</a>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
</li>
|
||||
<li class="layui-nav-item">
|
||||
<a lay-href="//baidu.com"><i class="layui-icon layui-icon-unlink"></i> <cite>一级菜单</cite></a>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -220,7 +93,7 @@
|
||||
<div class="layui-body"></div>
|
||||
<!-- 底部 -->
|
||||
<div class="layui-footer">
|
||||
copyright 2017 ~ © {:date('Y', time())} <a href="http://easyweb.vip" target="_blank">catchadmin.com</a> all rights reserved.
|
||||
copyright 2017 ~ © {:date('Y', time())} <a href="https://catchadmin.com" target="_blank">catchadmin.com</a> all rights reserved.
|
||||
<span class="pull-right">Version 2.0</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -242,7 +115,7 @@
|
||||
|
||||
// 默认加载主页
|
||||
index.loadHome({
|
||||
menuPath: 'page/console/console.html',
|
||||
menuPath: '{:url("dashboard")}',
|
||||
menuName: '<i class="layui-icon layui-icon-home"></i>'
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user