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 @@ - +
- -99,666
+总计访问量88万
+33,555
+新下载10%
+99,666
+总Start数88万
+66,666
+最近一个月15%
+PHP 版本 | +{$Think.PHP_VERSION} | +|
MYSQL 版本 | +{$mysql_version} | +|
WEB 服务器 | +{$_SERVER['SERVER_SOFTWARE']} | +|
操作系统 | +{$Think.PHP_OS} | +|
opcache (建议开启) | + {if condition="function_exists('opcache_get_configuration')"} +{:opcache_get_configuration()['directives']['opcache.enable'] ? '开启' : '关闭' } | + {else/} +未开启 | + {/if} +
最大执行时间 | +{:get_cfg_var("max_execution_time")} s | +|
上传限制大小(M) | +{:get_cfg_var ("upload_max_filesize")} | +|
当前时间 | +{:date("Y-m-d H:i:s")} | +|
核心框架 | +Thinkphp v6 | +