diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 35de76d6f..d1e2ce5c1 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -2249,11 +2249,10 @@ - + 根据用户Id获取用户详细信息[New] - xiuga diff --git a/IRaCIS.Core.Application/Service/Management/UserService.cs b/IRaCIS.Core.Application/Service/Management/UserService.cs index 721cb148a..8972ea053 100644 --- a/IRaCIS.Core.Application/Service/Management/UserService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserService.cs @@ -509,16 +509,16 @@ namespace IRaCIS.Core.Application.Service /// /// 根据用户Id获取用户详细信息[New] /// - /// /// xiuga - [HttpGet("{userId:guid}")] - public async Task GetUser(Guid userId) + + public async Task GetUser() { - var userQuery = _userRepository.Where(t => t.Id == userId).ProjectTo(_mapper.ConfigurationProvider); + var userQuery = _userRepository.Where(t => t.IdentityUserId == _userInfo.IdentityUserId).ProjectTo(_mapper.ConfigurationProvider); var userRole = await userQuery.FirstOrDefaultAsync(); - userRole.AccountList = await _userRepository.Where(t => t.IdentityUserId == userRole.IdentityUserId).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + userRole.AccountList = await _userRepository.Where(t => t.IdentityUserId == _userInfo.IdentityUserId).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + return userRole; } @@ -912,10 +912,11 @@ namespace IRaCIS.Core.Application.Service [AllowAnonymous] [HttpGet] - public async Task LoginOut(Guid userId) + public async Task LoginOut(Guid identityUserId) { - await _fusionCache.RemoveAsync(CacheKeys.UserToken(_userInfo.IdentityUserId)); - await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, LoginUserId = userId, OptUserId = _userInfo.Id, OptType = UserOptType.LoginOut }, true); + await _fusionCache.RemoveAsync(CacheKeys.UserToken(identityUserId)); + + //await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, LoginUserId = userId, OptUserId = _userInfo.Id, OptType = UserOptType.LoginOut }, true); return ResponseOutput.Ok(); }