From 60a54b6a75d26a4604e6009f84f7d1195918f881 Mon Sep 17 00:00:00 2001 From: wolfcode <37436228+wolf-leo@users.noreply.github.com> Date: Wed, 21 Jun 2023 00:43:31 +0800 Subject: [PATCH] update --- app/admin/controller/Index.php | 17 +++++++---- app/admin/view/index/welcome.html | 51 +++++++++++++++++++++++-------- public/static/admin/js/index.js | 3 +- 3 files changed, 51 insertions(+), 20 deletions(-) diff --git a/app/admin/controller/Index.php b/app/admin/controller/Index.php index b61496e..9581abd 100644 --- a/app/admin/controller/Index.php +++ b/app/admin/controller/Index.php @@ -10,6 +10,7 @@ use think\App; use think\db\exception\DataNotFoundException; use think\db\exception\DbException; use think\db\exception\ModelNotFoundException; +use think\facade\Db; use think\facade\Env; class Index extends AdminController @@ -34,12 +35,16 @@ class Index extends AdminController */ public function welcome(): string { - $quicks = SystemQuick::field('id,title,icon,href') + $tpVersion = \think\facade\App::version(); + $mysqlVersion = Db::query("select version() as version")[0]['version'] ?? '未知'; + $phpVersion = phpversion(); + $versions = compact('tpVersion', 'mysqlVersion', 'phpVersion'); + $quicks = SystemQuick::field('id,title,icon,href') ->where(['status' => 1]) ->order('sort', 'desc') ->limit(8) ->select(); - $this->assign('quicks', $quicks); + $this->assign(compact('quicks', 'versions')); return $this->fetch(); } @@ -52,7 +57,7 @@ class Index extends AdminController */ public function editAdmin(): string { - $id = session('admin.id'); + $id = session('admin.id'); $row = (new SystemAdmin()) ->withoutField('password') ->find($id); @@ -84,7 +89,7 @@ class Index extends AdminController */ public function editPassword(): string { - $id = session('admin.id'); + $id = session('admin.id'); $row = (new SystemAdmin()) ->withoutField('password') ->find($id); @@ -105,8 +110,8 @@ class Index extends AdminController try { $save = $row->save([ - 'password' => password($post['password']), - ]); + 'password' => password($post['password']), + ]); } catch (Exception $e) { $this->error('保存失败'); } diff --git a/app/admin/view/index/welcome.html b/app/admin/view/index/welcome.html index 491b7e3..a0c6c06 100644 --- a/app/admin/view/index/welcome.html +++ b/app/admin/view/index/welcome.html @@ -111,38 +111,65 @@
| 框架名称 | - EasyAdmin8 + + | +|
| ThinkPHP版本 | ++ + | +|
| PHP版本 | ++ + | +|
| MySQL版本 | ++ + | +|
| Layui版本 | ++ | |
| 主要特色 | -零门槛 / 响应式 / 清爽 / 极简 | ++ 零门槛 + 响应式 + 清爽 + 极简 + |
| Gitee | -+ | |
| Github | -- + | + + + |