李昊 4 years ago
parent
commit
898da0d9c3
1 changed files with 6 additions and 3 deletions
  1. 6 3
      GxPress/Api/GxPress.Api/AppControllers/AppProcessController.cs

+ 6 - 3
GxPress/Api/GxPress.Api/AppControllers/AppProcessController.cs

@@ -35,9 +35,12 @@ namespace GxPress.Api.AppControllers
         /// </summary>
         /// <returns></returns>
         [HttpGet]
-        public async Task<IEnumerable<Process>> GetProcessList()
+        public async Task<List<Process>> GetProcessList()
         {
-            return await _processRepository.GetListByDepartmentIdAsync(_loginContext.DepartmentId);
+            if (_loginContext.DepartmentId == 0)
+                return new List<Process>();
+            var result = await _processRepository.GetListByDepartmentIdAsync(_loginContext.DepartmentId);
+            return result.ToList();
         }
 
         /// <summary>
@@ -52,7 +55,7 @@ namespace GxPress.Api.AppControllers
             {
                 Id = processDto.Id,
                 Name = processDto.Name,
-                IconUrl =StringUtils.AddDomain(processDto.IconUrl),
+                IconUrl = StringUtils.AddDomain(processDto.IconUrl),
                 Description = processDto.Description,
                 FormFields = processDto.FormFields,
                 AllowApproverCheck = processDto.AllowApproverCheck,