Explorar el Código

后:二级用户改人员部门

dubch hace 5 años
padre
commit
d7a6eb4b1a
Se han modificado 1 ficheros con 8 adiciones y 6 borrados
  1. 8 6
      src/dashoo.cn/backend/api/controllers/casbin/user.go

+ 8 - 6
src/dashoo.cn/backend/api/controllers/casbin/user.go

@@ -437,12 +437,14 @@ func (this *UserController) EditUser() {
 		if model.Superior != "" {
 			//改所属单位
 			str := strings.Split(model.Superior, ",")
-			if str[2] != "" {
-				var entity organize.Base_Organize
-				svc := organize.GetOrganizeService(utils.DBE)
-				svc.GetEntityById (str[2], &entity)
-				userentity.UnitId,_ = strconv.Atoi(str[2])
-				userentity.Unit = entity.Fullname
+			if str[0] == "100000000" {
+				if str[2] != "" {
+					var entity organize.Base_Organize
+					svc := organize.GetOrganizeService(utils.DBE)
+					svc.GetEntityById (str[2], &entity)
+					userentity.UnitId,_ = strconv.Atoi(str[2])
+					userentity.Unit = entity.Fullname
+				}
 			}
 		}
 		var cols []string = []string{"Realname", "CompanyId", "DepartmentId", "DepartmentName", "Telephone", "Mobile", "Description", "Photo", "Modifieduserid", "Modifiedby", "Superior", "Unit", "UnitId"}