fix: 修复注册异常,删除用户异常,调整用户信息存储时间

This commit is contained in:
2025-02-23 03:58:38 +08:00
parent 5be35d8231
commit df5f2977d4
10 changed files with 984 additions and 32 deletions

View File

@@ -31,7 +31,7 @@ roleAPI = APIRouter(
@Auth(permission_list=["role:btn:add"])
async def add_role(request: Request, params: AddRoleParams,
current_user: dict = Depends(LoginController.get_current_user)):
if await Role.get_or_none(code=params.role_code, department_id=params.department_id, del_flag=1):
if await Role.get_or_none(code=params.code, department_id=params.department_id, del_flag=1):
return Response.error(msg="角色编码已存在!")
sub_departments = current_user.get("sub_departments")
if params.department_id not in sub_departments:
@@ -47,10 +47,10 @@ async def add_role(request: Request, params: AddRoleParams,
)
else:
role = await Role.create(
code=params.role_code,
name=params.role_name,
code=params.code,
name=params.name,
status=params.status,
description=params.role_description,
description=params.description,
department_id=None,
)
if role: