refactor: 使用 getFirst 优化首元素访问
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user