diff --git a/.env b/.env index 6acdc4bd..9c13fa88 100644 --- a/.env +++ b/.env @@ -1,4 +1,4 @@ [APP] NAME = Lsky Pro -DEBUG = false +DEBUG = true TRACE = false diff --git a/.gitignore b/.gitignore index 2bcee80a..eb7a8180 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ .idea runtime +/config/db.php # Icon must end with two \r Icon diff --git a/application/index/controller/admin/Users.php b/application/index/controller/admin/Users.php index 2b82ca2f..189bae5a 100644 --- a/application/index/controller/admin/Users.php +++ b/application/index/controller/admin/Users.php @@ -122,10 +122,13 @@ class Users extends Base if (!$user = UserModel::get($id)) { return $this->error('数据获取失败'); } + if ($user->id === $this->user->id) { + return $this->error('不可修改自己的状态'); + } if (!$user->where('id', $id)->setField('state', $state)) { return $this->error('状态修改失败'); } return $this->success('状态修改成功'); } } -} \ No newline at end of file +}