Browse Source

fix:部门删除

zqbao 9 months ago
parent
commit
b0f079e7b0
1 changed files with 3 additions and 0 deletions
  1. 3 0
      services/sys_department.go

+ 3 - 0
services/sys_department.go

@@ -39,6 +39,9 @@ func DeleteSysDepartmentById(sysDepartmentId, level int) (err error) {
 		}
 		curIds = make([]string, 0)
 		for _, dep := range sysDepartments {
+			if dep.SysDepartmentId == 0 {
+				continue
+			}
 			sysDepartmentIds = append(sysDepartmentIds, strconv.Itoa(dep.SysDepartmentId))
 			curIds = append(curIds, strconv.Itoa(dep.SysDepartmentId))
 		}