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="新生"