From 2ba8392f2cd40c975df0b53efa798a4d046328ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=8D=8E=E6=B8=85?= <18691022700@163.com> Date: Tue, 16 Dec 2025 18:40:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=86=E7=A0=81=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=20=E6=8F=90=E7=A4=BA=E7=89=B9=E6=AE=8A=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/model/UserData.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/application/api/model/UserData.php b/application/api/model/UserData.php index 99bc3294..6b691ecd 100644 --- a/application/api/model/UserData.php +++ b/application/api/model/UserData.php @@ -255,6 +255,10 @@ class UserData extends Model return ['code' => 0, 'msg' => '登录失效,请重新登录','data' =>null]; } + $old_password = db::name('user')->where('id' , $user_id)->value('password'); + if ($old_password == md5($password)) { + return ['code' => 0, 'msg' => '修改失败了!','data' =>null]; + } $reslut = db::name('user')->where('id' , $user_id)->update(['password' => md5($password)]); if ($reslut) {