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 | -- + | + + + |