This commit is contained in:
lizhicheng 2022-09-27 16:10:42 +08:00
parent 3c0d9ab8b3
commit 22eea4c2f5
1 changed files with 5 additions and 1 deletions

View File

@ -15,6 +15,7 @@ import io.renren.modules.security.password.PasswordUtils;
import io.renren.modules.security.user.SecurityUser; import io.renren.modules.security.user.SecurityUser;
import io.renren.modules.security.user.UserDetail; import io.renren.modules.security.user.UserDetail;
import io.renren.modules.sys.dto.PasswordDTO; 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.dto.SysUserDTO;
import io.renren.modules.sys.excel.SysUserExcel; import io.renren.modules.sys.excel.SysUserExcel;
import io.renren.modules.sys.service.SysDeptService; import io.renren.modules.sys.service.SysDeptService;
@ -92,7 +93,10 @@ public class SysUserController {
@ApiOperation("登录用户信息") @ApiOperation("登录用户信息")
public Result<SysUserDTO> info(){ public Result<SysUserDTO> info(){
SysUserDTO data = ConvertUtils.sourceToTarget(SecurityUser.getUser(), SysUserDTO.class); 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())); data.setRoleIdList(sysRoleUserService.getRoleIdList(data.getId()));
return new Result<SysUserDTO>().ok(data); return new Result<SysUserDTO>().ok(data);
} }