From 22eea4c2f5cbd3a9b35519f4c5a6de712f491bdb Mon Sep 17 00:00:00 2001 From: lizhicheng Date: Tue, 27 Sep 2022 16:10:42 +0800 Subject: [PATCH] bug fix --- .../io/renren/modules/sys/controller/SysUserController.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/renren-admin/src/main/java/io/renren/modules/sys/controller/SysUserController.java b/renren-admin/src/main/java/io/renren/modules/sys/controller/SysUserController.java index e097429e..eca23481 100644 --- a/renren-admin/src/main/java/io/renren/modules/sys/controller/SysUserController.java +++ b/renren-admin/src/main/java/io/renren/modules/sys/controller/SysUserController.java @@ -15,6 +15,7 @@ import io.renren.modules.security.password.PasswordUtils; import io.renren.modules.security.user.SecurityUser; import io.renren.modules.security.user.UserDetail; import io.renren.modules.sys.dto.PasswordDTO; +import io.renren.modules.sys.dto.SysDeptDTO; import io.renren.modules.sys.dto.SysUserDTO; import io.renren.modules.sys.excel.SysUserExcel; import io.renren.modules.sys.service.SysDeptService; @@ -92,7 +93,10 @@ public class SysUserController { @ApiOperation("登录用户信息") public Result info(){ SysUserDTO data = ConvertUtils.sourceToTarget(SecurityUser.getUser(), SysUserDTO.class); - data.setDeptName(sysDeptService.get(data.getDeptId()).getName()); + SysDeptDTO sysDeptDTO=sysDeptService.get(data.getDeptId()); + if(sysDeptDTO != null){ + data.setDeptName(sysDeptService.get(data.getDeptId()).getName()); + } data.setRoleIdList(sysRoleUserService.getRoleIdList(data.getId())); return new Result().ok(data); }