From 92e296ddc0621234172da279a42bf66bda60c98f Mon Sep 17 00:00:00 2001 From: derek <2865900737@qq.com> Date: Mon, 25 Nov 2019 22:07:24 +0800 Subject: [PATCH] optimized code --- app/Controller/Admin/SysUserController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Controller/Admin/SysUserController.php b/app/Controller/Admin/SysUserController.php index 6c04832..20deb7c 100644 --- a/app/Controller/Admin/SysUserController.php +++ b/app/Controller/Admin/SysUserController.php @@ -13,6 +13,7 @@ use App\Annotation\SysLogAnnotation; +use App\Constants\Constants; use App\Controller\AbstractController; use App\Model\Dao\SysUserDao; use App\Service\Formatter\SysUserFormatter; @@ -204,7 +205,7 @@ public function sysUserDelete() return $this->response->error("提交错误"); } - if (in_array("1", $params)) { + if (in_array(Constants::SYS_ADMIN_ID, $params)) { return $this->response->error("超级管理员不能删除"); }