feat(mall): 代码优化

master
waynaqua 1 year ago
parent 19567df1de
commit 31d266845b

@ -97,7 +97,10 @@ public class UserController {
LoginUserDetail loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); LoginUserDetail loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
Member member = loginUser.getMember(); Member member = loginUser.getMember();
member.setAvatar(avatar); member.setAvatar(avatar);
boolean update = iMemberService.updateById(member); boolean update = iMemberService.lambdaUpdate()
.set(Member::getAvatar, avatar)
.eq(Member::getId, member.getId())
.update();
if (!update) { if (!update) {
throw new BusinessException("上传头像失败"); throw new BusinessException("上传头像失败");
} }

Loading…
Cancel
Save