From 667608d2331489765d12a0797ac29892afc7b052 Mon Sep 17 00:00:00 2001 From: augushong Date: Thu, 22 Feb 2024 22:30:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=8C=96=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=EF=BC=9B=E6=96=B0=E5=A2=9E=E5=85=A8=E5=B1=80=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=AD=98=E5=82=A8=E5=B7=A5=E5=85=B7=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/tools/StoreValueTools.php | 9 +++++ extend/base/BaseControllerBase.php | 25 +++++++------- extend/base/admin/view/index/welcome.html | 21 ++++++++---- .../base/common/tools/StoreValueToolsBase.php | 33 +++++++++++++++++++ extend/base/helper.php | 11 +++++++ 5 files changed, 80 insertions(+), 19 deletions(-) create mode 100644 app/common/tools/StoreValueTools.php create mode 100644 extend/base/common/tools/StoreValueToolsBase.php diff --git a/app/common/tools/StoreValueTools.php b/app/common/tools/StoreValueTools.php new file mode 100644 index 0000000..6560b72 --- /dev/null +++ b/app/common/tools/StoreValueTools.php @@ -0,0 +1,9 @@ +app = $app; + $this->app = $app; $this->request = $this->app->request; // 控制器初始化 @@ -55,13 +55,12 @@ abstract class BaseControllerBase // 初始化 protected function initialize() { - Log::debug('request url :' . $this->request->url()); + StoreValueTools::set('request_uid', uniqid()); } /** - * 验证数据 - * @access protected + * 验证数据. * @param array $data 数据 * @param string|array $validate 验证器名或者验证规则数组 * @param array $message 提示信息 @@ -74,7 +73,7 @@ abstract class BaseControllerBase if (is_array($validate)) { $v = new Validate(); $v->rule($validate); - } else if ($validate instanceof Validate) { + } elseif ($validate instanceof Validate) { $v = $validate; } else { if (strpos($validate, '.')) { @@ -82,7 +81,7 @@ abstract class BaseControllerBase list($validate, $scene) = explode('.', $validate); } $class = false !== strpos($validate, '\\') ? $validate : $this->app->parseClass('validate', $validate); - $v = new $class(); + $v = new $class(); if (!empty($scene)) { $v->scene($scene); } diff --git a/extend/base/admin/view/index/welcome.html b/extend/base/admin/view/index/welcome.html index 325992e..8e7bd5b 100644 --- a/extend/base/admin/view/index/welcome.html +++ b/extend/base/admin/view/index/welcome.html @@ -125,7 +125,8 @@ 当前版本 - {:\\app\\common\\command\\admin\\Version::VERSION} + + {:\\app\\common\\command\\admin\\Version::VERSION} 最新修改 @@ -139,8 +140,10 @@ Gitee
- star - fork + star + fork
@@ -159,7 +162,11 @@ 日志 -
今日日志
+
+ 今日日志 +
+
请求ID:{:get_store_value('request_uid')}
@@ -170,8 +177,10 @@
作者心语
-

本模板基于layui{:\\app\\common\\command\\admin\\Version::LAYUI_VERSION}以及font-awesome-4.7.0进行实现。layui开发文档地址:layui文档

-

技术交流QQ群:ulthon_admin(加群请备注来源:如gitee、github、官网等)

+

本模板基于layui{:\\app\\common\\command\\admin\\Version::LAYUI_VERSION}以及font-awesome-4.7.0进行实现。layui开发文档地址:layui文档

+

技术交流QQ群:ulthon_admin(加群请备注来源:如gitee、github、官网等)

喜欢此后台模板的可以给我的GitHub和Gitee加个Star支持一下

备注:此后台框架永久开源,但请勿进行出售或者上传到任何素材网站,否则将追究相应的责任。

diff --git a/extend/base/common/tools/StoreValueToolsBase.php b/extend/base/common/tools/StoreValueToolsBase.php new file mode 100644 index 0000000..c04ea58 --- /dev/null +++ b/extend/base/common/tools/StoreValueToolsBase.php @@ -0,0 +1,33 @@ +