refactor: 使用 getFirst 优化首元素访问

This commit is contained in:
疯狂的狮子Li
2026-06-11 13:57:43 +08:00
parent d8f8d5493d
commit 0d72999366
14 changed files with 22 additions and 22 deletions
@@ -93,7 +93,7 @@ public class SysLoginService {
remoteSocialService.insertByBo(bo);
} else {
// 更新用户信息
bo.setId(list.get(0).getId());
bo.setId(list.getFirst().getId());
remoteSocialService.updateByBo(bo);
// 如果要绑定的平台账号已经被绑定过了 是否抛异常自行决断
// throw new ServiceException("此平台账号已经被绑定!");
@@ -65,7 +65,7 @@ public class SocialAuthStrategy implements IAuthStrategy {
if (CollUtil.isEmpty(list)) {
throw new ServiceException("你还没有绑定第三方账号,绑定后才可以登录!");
}
RemoteSocialVo socialVo = list.get(0);
RemoteSocialVo socialVo = list.getFirst();
LoginUser loginUser = remoteUserService.getUserInfo(socialVo.getUserId());
loginUser.setClientKey(client.getClientKey());