From b490043f2e2261c742304b9f296a6ee2e78c6fc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E9=B8=9F=E7=94=9F=E4=BA=A7?= Date: Wed, 18 Mar 2026 13:35:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=AF=86=E7=A0=81=E6=8E=A5=E5=8F=A3=E6=95=B0=E6=8D=AE=E5=BA=93?= =?UTF-8?q?=E4=B8=8D=E6=9B=B4=E6=96=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/routers/auth.py | 9 +++++++-- config/VERSION | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/backend/app/routers/auth.py b/backend/app/routers/auth.py index f77cf67..4dba044 100644 --- a/backend/app/routers/auth.py +++ b/backend/app/routers/auth.py @@ -106,15 +106,20 @@ def change_password( """修改当前用户密码""" from app.core.auth import verify_password, get_password_hash + # 在当前session中重新查询用户 + user = db.query(User).filter(User.f99_90_id == current_user.f99_90_id).first() + if not user: + raise HTTPException(status_code=404, detail="用户不存在") + # 验证旧密码 - if not verify_password(old_password, current_user.password): + if not verify_password(old_password, user.password): raise HTTPException( status_code=status.HTTP_400_BAD_REQUEST, detail="当前密码错误" ) # 更新密码 - current_user.password = get_password_hash(new_password) + user.password = get_password_hash(new_password) db.commit() return {"message": "密码修改成功"} diff --git a/config/VERSION b/config/VERSION index b36f410..8cb3856 100644 --- a/config/VERSION +++ b/config/VERSION @@ -2,7 +2,7 @@ # Version Configuration for Zodiac Collection Management System # 当前版本号 (语义化版本:主版本。次版本.修订版) -VERSION=1.1.2 +VERSION=1.1.3 # 版本代号 (可选) VERSION_CODENAME="新生"