Skip to content

Commit f485a6d

Browse files
committed
Update auth failed default status code
1 parent a4c7dae commit f485a6d

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

backend/app/admin/api/v1/sys/user.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,7 @@ async def multi_set(request: Request, pk: Annotated[int, Path(description='用
126126

127127
@router.delete(
128128
path='/{username}',
129-
summary='用户注销',
130-
description='用户注销 != 用户登出,注销之后用户将从数据库删除',
129+
summary='删除用户',
131130
dependencies=[
132131
Depends(RequestPermission('sys:user:del')),
133132
DependsRBAC,

backend/common/exception/errors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def __init__(self, *, msg: str = 'Bad Gateway', data: Any = None, background: Ba
8585
class AuthorizationError(BaseExceptionMixin):
8686
"""授权异常"""
8787

88-
code = StandardResponseCode.HTTP_401
88+
code = StandardResponseCode.HTTP_403
8989

9090
def __init__(self, *, msg: str = 'Permission Denied', data: Any = None, background: BackgroundTask | None = None):
9191
super().__init__(msg=msg, data=data, background=background)

0 commit comments

Comments
 (0)