From a0a62b5640e0a4d390cdfe4e415117ab201bae0f Mon Sep 17 00:00:00 2001 From: wuyanwen Date: Thu, 12 Dec 2019 18:52:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=BB=98=E8=AE=A4=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- catchAdmin/index/controller/Index.php | 34 +++- catchAdmin/index/route.php | 5 +- catchAdmin/index/view/dashboard.html | 217 +++++++++++++++++++++++++- catchAdmin/index/view/error.html | 16 +- catchAdmin/index/view/index.html | 159 ++----------------- 5 files changed, 266 insertions(+), 165 deletions(-) diff --git a/catchAdmin/index/controller/Index.php b/catchAdmin/index/controller/Index.php index 6112225..36636e7 100644 --- a/catchAdmin/index/controller/Index.php +++ b/catchAdmin/index/controller/Index.php @@ -1,19 +1,35 @@ 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'], + ]); + } } \ No newline at end of file diff --git a/catchAdmin/index/route.php b/catchAdmin/index/route.php index 56b9e99..a3c0e5e 100644 --- a/catchAdmin/index/route.php +++ b/catchAdmin/index/route.php @@ -1,4 +1,5 @@ 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'); diff --git a/catchAdmin/index/view/dashboard.html b/catchAdmin/index/view/dashboard.html index 566549b..38a2c62 100644 --- a/catchAdmin/index/view/dashboard.html +++ b/catchAdmin/index/view/dashboard.html @@ -1,10 +1,221 @@ - + - - Title + + + + CatchAdmin 后台开发框架 + + + + + + +
+
+ +
+
+ + +
+
+
+
+
+ 访问量 +
+
+

99,666

+

总计访问量88万

+
+
+
+
+
+
+ 下载 +
+
+

33,555

+

新下载10%

+
+
+
+
+
+
+ Start +
+
+

99,666

+

总Start数88万

+
+
+
+
+
+
+ 活跃用户 +
+
+

66,666

+

最近一个月15%

+
+
+
+
+ +
+
+
+
更新日志
+
+
    +
  • + +
    +

    + V1.0 + catchAdmin 后台框架  + 2019-11-14 +

    +
      +
    • 基于 Thinkphp6 & layui 开发
    • +
    • 完整的权限管理
    • +
    • 模块化开发方式
    • +
    • ...
    • +
    +
    +
  • +
  • + +
    +
    + CatchAdmin 开发中... 更早 +
    +
    +
  • +
+
+
+
+
+
+
后台框架
+
+ + + + + + + + + + + + + + + + + + + + + + + + + {if condition="function_exists('opcache_get_configuration')"} + + {else/} + + {/if} + + + + + + + + + + + + + + + + + + +
PHP 版本{$Think.PHP_VERSION}
MYSQL 版本{$mysql_version}
WEB 服务器{$_SERVER['SERVER_SOFTWARE']}
操作系统{$Think.PHP_OS}
opcache (建议开启){:opcache_get_configuration()['directives']['opcache.enable'] ? '开启' : '关闭' }未开启
最大执行时间{:get_cfg_var("max_execution_time")} s
上传限制大小(M){:get_cfg_var ("upload_max_filesize")}
当前时间{:date("Y-m-d H:i:s")}
核心框架Thinkphp v6
+
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/catchAdmin/index/view/error.html b/catchAdmin/index/view/error.html index 7a7a87d..eb66fb3 100644 --- a/catchAdmin/index/view/error.html +++ b/catchAdmin/index/view/error.html @@ -15,19 +15,12 @@ - -
-
- -
-
-

403

-
抱歉,你无权访问此页面
+
{$msg}
@@ -37,12 +30,5 @@ - \ No newline at end of file diff --git a/catchAdmin/index/view/index.html b/catchAdmin/index/view/index.html index af758f3..b15d846 100644 --- a/catchAdmin/index/view/index.html +++ b/catchAdmin/index/view/index.html @@ -45,7 +45,7 @@
  • - 管理员 + {$username}
    @@ -56,7 +56,7 @@

    - 退出 + 退出
  • @@ -71,147 +71,20 @@
    @@ -220,7 +93,7 @@
    @@ -242,7 +115,7 @@ // 默认加载主页 index.loadHome({ - menuPath: 'page/console/console.html', + menuPath: '{:url("dashboard")}', menuName: '' });