!854 update 优化使用getFirst()替代get(0)以提高代码可读性
* update 优化使用getFirst()替代get(0)以提高代码可读性
This commit is contained in:
@@ -97,7 +97,7 @@ public class SysLoginService {
|
||||
sysSocialService.insertByBo(bo);
|
||||
} else {
|
||||
// 更新用户信息
|
||||
bo.setId(list.get(0).getId());
|
||||
bo.setId(list.getFirst().getId());
|
||||
sysSocialService.updateByBo(bo);
|
||||
// 如果要绑定的平台账号已经被绑定过了 是否抛异常自行决断
|
||||
// throw new ServiceException("此平台账号已经被绑定!");
|
||||
|
||||
@@ -68,7 +68,7 @@ public class SocialAuthStrategy implements IAuthStrategy {
|
||||
if (CollUtil.isEmpty(list)) {
|
||||
throw new ServiceException("你还没有绑定第三方账号,绑定后才可以登录!");
|
||||
}
|
||||
SysUserVo user = loadUser(list.get(0).getUserId());
|
||||
SysUserVo user = loadUser(list.getFirst().getUserId());
|
||||
// 此处可根据登录用户的数据不同 自行创建 loginUser 属性不够用继承扩展就行了
|
||||
LoginUser loginUser = loginService.buildLoginUser(user);
|
||||
loginUser.setClientKey(client.getClientKey());
|
||||
|
||||
Reference in New Issue
Block a user