From f5cced1d7a13381112ce8b9bc382d14bd39a50fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Sun, 29 Dec 2024 18:18:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=94=A8=E6=88=B7=E8=B4=A6?= =?UTF-8?q?=E5=8F=B7=E5=8F=8A=E5=AF=86=E7=A0=81=E4=BF=AE=E6=94=B9=E7=9A=84?= =?UTF-8?q?=E5=8F=96=E5=80=BC=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/think-plugs-admin/src/controller/Index.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/plugin/think-plugs-admin/src/controller/Index.php b/plugin/think-plugs-admin/src/controller/Index.php index f5127894b..9d61938b1 100644 --- a/plugin/think-plugs-admin/src/controller/Index.php +++ b/plugin/think-plugs-admin/src/controller/Index.php @@ -79,12 +79,11 @@ class Index extends Controller /** * 修改用户资料 * @login true - * @param mixed $id 用户ID */ - public function info($id = 0) + public function info() { - $this->_applyFormToken(); - if (AdminService::getUserId() === intval($id)) { + $id = $this->request->param('id'); + if (AdminService::getUserId() == intval($id)) { SystemUser::mForm('user/form', 'id', [], ['id' => $id]); } else { $this->error('只能修改自己的资料!'); @@ -116,14 +115,13 @@ class Index extends Controller /** * 修改当前用户密码 * @login true - * @param mixed $id * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException */ - public function pass($id = 0) + public function pass() { - $this->_applyFormToken(); + $id = $this->request->param('id'); if (AdminService::getUserId() !== intval($id)) { $this->error('禁止修改他人密码!'); }