From b63702fec3c1f58d8feed3f87e7eaf5d6ba3b6b4 Mon Sep 17 00:00:00 2001 From: wanghongjun <1445693971@qq,com> Date: Thu, 7 Sep 2023 17:00:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8D=E4=BD=BF=E7=94=A8session=20=E5=88=87?= =?UTF-8?q?=E6=8D=A2jwt=E6=95=B0=E6=8D=AE2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/User.php | 2 +- app/model/User.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controller/User.php b/app/controller/User.php index cde4168..2f98dcd 100644 --- a/app/controller/User.php +++ b/app/controller/User.php @@ -30,7 +30,7 @@ class User extends BaseController $userModel = new UserModel(); - $user = $userModel->modifyPassword($data); + $user = $userModel->modifyPassword($data,$this->request->userInfo['id']); if ($user['status']) { return $this->renderSuccess('修改成功'); diff --git a/app/model/User.php b/app/model/User.php index 44153e1..00547b0 100644 --- a/app/model/User.php +++ b/app/model/User.php @@ -125,9 +125,9 @@ class User extends Model * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException */ - public function modifyPassword($data) + public function modifyPassword($data,$user_id) { - $user = $this->request->userInfo; + $user = ['id' => $user_id]; if ($user) {