mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-21 12:52:26 +00:00
fix(system): 优化部门、菜单、公告、岗位、角色和用户管理功能
- 增加创建、更新和删除操作的异常处理 - 优化错误提示信息 - 重置表单状态以解决数据残留问题 - 统一错误处理方式,使用 message 组件替代 notification
This commit is contained in:
@@ -244,7 +244,7 @@ class UserService:
|
||||
# 检查用户名是否存在
|
||||
user = await UserCRUD(auth).get_user_by_username(username=data.username)
|
||||
if user:
|
||||
raise CustomException(msg='用户名已存在')
|
||||
raise CustomException(msg='注册失败,用户名已存在')
|
||||
|
||||
data.password = PwdUtil.set_password_hash(password=data.password)
|
||||
dict_data = data.model_dump(exclude_unset=True)
|
||||
|
||||
Reference in New Issue
Block a user