!974 获取不到用户引发的NPE异常

Merge pull request !974 from g_l/N/A
This commit is contained in:
芋道源码 2024-05-18 12:27:24 +00:00 committed by Gitee
commit c18509944f
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -119,6 +119,7 @@ public class UserController {
@PreAuthorize("@ss.hasPermission('system:user:query')")
public CommonResult<UserRespVO> getUser(@RequestParam("id") Long id) {
AdminUserDO user = userService.getUser(id);
if (ObjectUtil.isEmpty(user)) return CommonResult.success(null);
// 拼接数据
DeptDO dept = deptService.getDept(user.getDeptId());
return success(UserConvert.INSTANCE.convert(user, dept));