lyhzzz 2 lat temu
rodzic
commit
6142df51af

+ 9 - 6
src/main/java/com/cdf/controller/back/SysDeptController.java

@@ -108,13 +108,16 @@ public class SysDeptController extends BaseLogController{
         DeptVo vo = new DeptVo();
         BeanUtils.copyProperties(dept,vo);
         vo.setChildren(deptService.getDeptList(user.getDeptId()));
+        if(user.getDeptId() != null){
+            DeptVo vot = new DeptVo();
 
-        DeptVo vot = new DeptVo();
-        Dept deptt = deptService.getById(1);
-        BeanUtils.copyProperties(deptt,vot);
-        vot.setHasChildren(0);
-        vot.setChildren(Arrays.asList(vo));
-        return ResultData.ok(Arrays.asList(vot));
+            Dept deptt = deptService.getById(1);
+            BeanUtils.copyProperties(deptt,vot);
+            vot.setHasChildren(0);
+            vot.setChildren(Arrays.asList(vo));
+            return ResultData.ok(Arrays.asList(vot));
+        }
+        return ResultData.ok(Arrays.asList(vo));
     }