From fd0e8b332209e2218af5810eda8572f42580465a Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Thu, 23 Nov 2023 18:09:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=94=A8=E6=88=B7=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/adminapi/controller/BaseAdminController.php | 1 + app/adminapi/controller/land/LandPlantActionController.php | 6 +++--- app/adminapi/http/middleware/LoginMiddleware.php | 2 +- app/common/cache/AdminTokenCache.php | 1 + 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/adminapi/controller/BaseAdminController.php b/app/adminapi/controller/BaseAdminController.php index 66e8ccea..db1bbe17 100644 --- a/app/adminapi/controller/BaseAdminController.php +++ b/app/adminapi/controller/BaseAdminController.php @@ -34,6 +34,7 @@ class BaseAdminController extends BaseLikeAdminController if (isset($this->request->adminInfo) && $this->request->adminInfo) { $this->adminInfo = $this->request->adminInfo; $this->adminId = $this->request->adminInfo['admin_id']; + $this->userId = $this->request->adminInfo['user_id']; } } diff --git a/app/adminapi/controller/land/LandPlantActionController.php b/app/adminapi/controller/land/LandPlantActionController.php index d8963b91..fc6b8e2e 100644 --- a/app/adminapi/controller/land/LandPlantActionController.php +++ b/app/adminapi/controller/land/LandPlantActionController.php @@ -16,9 +16,9 @@ namespace app\adminapi\controller\land; -use app\adminapi\controller\BaseAdminController; -use app\adminapi\lists\land\LandPlantActionLists; -use app\adminapi\logic\land\LandPlantActionLogic; +use app\adminapi\controller\BaseAdminController; +use app\adminapi\lists\land\LandPlantActionLists; +use app\adminapi\logic\land\LandPlantActionLogic; use app\adminapi\validate\land\LandPlantActionValidate; diff --git a/app/adminapi/http/middleware/LoginMiddleware.php b/app/adminapi/http/middleware/LoginMiddleware.php index 0a09cef2..360288c9 100644 --- a/app/adminapi/http/middleware/LoginMiddleware.php +++ b/app/adminapi/http/middleware/LoginMiddleware.php @@ -71,7 +71,7 @@ class LoginMiddleware //给request赋值,用于控制器 $request->adminInfo = $adminInfo; $request->adminId = $adminInfo['admin_id'] ?? 0; - + $request->userId = $adminInfo['user_id'] ?? 0; return $next($request); } diff --git a/app/common/cache/AdminTokenCache.php b/app/common/cache/AdminTokenCache.php index fa16a9ba..c49b9aa2 100644 --- a/app/common/cache/AdminTokenCache.php +++ b/app/common/cache/AdminTokenCache.php @@ -89,6 +89,7 @@ class AdminTokenCache extends BaseCache $adminInfo = [ 'admin_id' => $admin->id, + 'user_id' => $admin->user_id, 'root' => $admin->root, 'name' => $admin->name, 'account' => $admin->account,