feat: token

This commit is contained in:
2026-06-16 18:20:11 +08:00
parent 5026c9b39c
commit b9ed1cd326
2 changed files with 63 additions and 22 deletions

View File

@@ -24,6 +24,7 @@ public class UserServiceImpl implements UserService {
@Override
public UserInfoResponse getCurrentUserInfo() {
String accountId = StpUtil.getLoginIdAsString();
log.info("[用户服务] 获取当前登录用户信息, accountId: {}", accountId);
UserEntity user = userRepository.findByAccountId(accountId)
.orElseThrow(() -> new BusinessException(ErrorCode.USER_NOT_FOUND));
return UserInfoResponse.from(user);