feat: 完成多模块功能迭代与优化
本次提交包含多模块功能更新: 1. 权限系统重构:移除硬编码admin放行逻辑,新增精细化权限控制,完善权限树形结构与用户/角色保护 2. 新增物料导入导出接口,补充台账查询条件 3. 优化列表查询排序逻辑,新增区域编码大小写不敏感搜索 4. 修复帮助抽屉重复弹出问题,补充页面权限控制 5. 新增弱密码提示逻辑,优化MES/WMS用户/角色管理权限 6. 调整路由结构,新增权限校验脚本与前端权限树重构 7. 补充数据库字段与依赖包更新
This commit is contained in:
@@ -69,6 +69,26 @@ func (_u *PermissionUpdate) SetNillableType(v *string) *PermissionUpdate {
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetParentCode sets the "parent_code" field.
|
||||
func (_u *PermissionUpdate) SetParentCode(v string) *PermissionUpdate {
|
||||
_u.mutation.SetParentCode(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableParentCode sets the "parent_code" field if the given value is not nil.
|
||||
func (_u *PermissionUpdate) SetNillableParentCode(v *string) *PermissionUpdate {
|
||||
if v != nil {
|
||||
_u.SetParentCode(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// ClearParentCode clears the value of the "parent_code" field.
|
||||
func (_u *PermissionUpdate) ClearParentCode() *PermissionUpdate {
|
||||
_u.mutation.ClearParentCode()
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetPath sets the "path" field.
|
||||
func (_u *PermissionUpdate) SetPath(v string) *PermissionUpdate {
|
||||
_u.mutation.SetPath(v)
|
||||
@@ -247,6 +267,11 @@ func (_u *PermissionUpdate) check() error {
|
||||
return &ValidationError{Name: "type", err: fmt.Errorf(`ent: validator failed for field "Permission.type": %w`, err)}
|
||||
}
|
||||
}
|
||||
if v, ok := _u.mutation.ParentCode(); ok {
|
||||
if err := permission.ParentCodeValidator(v); err != nil {
|
||||
return &ValidationError{Name: "parent_code", err: fmt.Errorf(`ent: validator failed for field "Permission.parent_code": %w`, err)}
|
||||
}
|
||||
}
|
||||
if v, ok := _u.mutation.Path(); ok {
|
||||
if err := permission.PathValidator(v); err != nil {
|
||||
return &ValidationError{Name: "path", err: fmt.Errorf(`ent: validator failed for field "Permission.path": %w`, err)}
|
||||
@@ -286,6 +311,12 @@ func (_u *PermissionUpdate) sqlSave(ctx context.Context) (_node int, err error)
|
||||
if value, ok := _u.mutation.GetType(); ok {
|
||||
_spec.SetField(permission.FieldType, field.TypeString, value)
|
||||
}
|
||||
if value, ok := _u.mutation.ParentCode(); ok {
|
||||
_spec.SetField(permission.FieldParentCode, field.TypeString, value)
|
||||
}
|
||||
if _u.mutation.ParentCodeCleared() {
|
||||
_spec.ClearField(permission.FieldParentCode, field.TypeString)
|
||||
}
|
||||
if value, ok := _u.mutation.Path(); ok {
|
||||
_spec.SetField(permission.FieldPath, field.TypeString, value)
|
||||
}
|
||||
@@ -387,6 +418,26 @@ func (_u *PermissionUpdateOne) SetNillableType(v *string) *PermissionUpdateOne {
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetParentCode sets the "parent_code" field.
|
||||
func (_u *PermissionUpdateOne) SetParentCode(v string) *PermissionUpdateOne {
|
||||
_u.mutation.SetParentCode(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableParentCode sets the "parent_code" field if the given value is not nil.
|
||||
func (_u *PermissionUpdateOne) SetNillableParentCode(v *string) *PermissionUpdateOne {
|
||||
if v != nil {
|
||||
_u.SetParentCode(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// ClearParentCode clears the value of the "parent_code" field.
|
||||
func (_u *PermissionUpdateOne) ClearParentCode() *PermissionUpdateOne {
|
||||
_u.mutation.ClearParentCode()
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetPath sets the "path" field.
|
||||
func (_u *PermissionUpdateOne) SetPath(v string) *PermissionUpdateOne {
|
||||
_u.mutation.SetPath(v)
|
||||
@@ -578,6 +629,11 @@ func (_u *PermissionUpdateOne) check() error {
|
||||
return &ValidationError{Name: "type", err: fmt.Errorf(`ent: validator failed for field "Permission.type": %w`, err)}
|
||||
}
|
||||
}
|
||||
if v, ok := _u.mutation.ParentCode(); ok {
|
||||
if err := permission.ParentCodeValidator(v); err != nil {
|
||||
return &ValidationError{Name: "parent_code", err: fmt.Errorf(`ent: validator failed for field "Permission.parent_code": %w`, err)}
|
||||
}
|
||||
}
|
||||
if v, ok := _u.mutation.Path(); ok {
|
||||
if err := permission.PathValidator(v); err != nil {
|
||||
return &ValidationError{Name: "path", err: fmt.Errorf(`ent: validator failed for field "Permission.path": %w`, err)}
|
||||
@@ -634,6 +690,12 @@ func (_u *PermissionUpdateOne) sqlSave(ctx context.Context) (_node *Permission,
|
||||
if value, ok := _u.mutation.GetType(); ok {
|
||||
_spec.SetField(permission.FieldType, field.TypeString, value)
|
||||
}
|
||||
if value, ok := _u.mutation.ParentCode(); ok {
|
||||
_spec.SetField(permission.FieldParentCode, field.TypeString, value)
|
||||
}
|
||||
if _u.mutation.ParentCodeCleared() {
|
||||
_spec.ClearField(permission.FieldParentCode, field.TypeString)
|
||||
}
|
||||
if value, ok := _u.mutation.Path(); ok {
|
||||
_spec.SetField(permission.FieldPath, field.TypeString, value)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user