From 4a91a43c30344a0e3d82bf3fa595dd454461d132 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Mon, 3 Jul 2023 08:35:32 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E9=97=AE=E9=A2=98=E8=BF=94?= =?UTF-8?q?=E5=9B=9E403=EF=BC=8C=E4=BB=A5=E4=BE=BFUI=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/db/userauth.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/db/userauth.py b/app/db/userauth.py index afd53fda..abd87226 100644 --- a/app/db/userauth.py +++ b/app/db/userauth.py @@ -13,7 +13,7 @@ def get_current_user( ) -> User: user = User.get(db, rid=token_data.sub) if not user: - raise HTTPException(status_code=404, detail="用户不存在") + raise HTTPException(status_code=403, detail="用户不存在") return user @@ -21,7 +21,7 @@ def get_current_active_user( current_user: User = Depends(get_current_user), ) -> User: if not current_user.is_active: - raise HTTPException(status_code=400, detail="用户未激活") + raise HTTPException(status_code=403, detail="用户未激活") return current_user