mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-21 20:55:14 +00:00
feat: 添加部门字段显示并优化用户界面
fix(service): 修复创建时编码重复检查问题 refactor(middleware): 优化CORS中间件配置 style(model): 更新用户模型默认性别值 perf(request): 增强前端请求错误处理 docs(cli): 改进命令行帮助文本 chore: 清理无用配置并更新依赖
This commit is contained in:
@@ -66,6 +66,9 @@ class RoleService:
|
||||
role = await RoleCRUD(auth).get(name=data.name)
|
||||
if role:
|
||||
raise CustomException(msg='创建失败,该角色已存在')
|
||||
obj = await RoleCRUD(auth).get(code=data.code)
|
||||
if obj:
|
||||
raise CustomException(msg='创建失败,编码已存在')
|
||||
new_role = await RoleCRUD(auth).create(data=data)
|
||||
return RoleOutSchema.model_validate(new_role).model_dump()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user