@ApiOperation(value = "更新用户信息", notes = "更新用户信息,包括手机号、邮箱、头像等", httpMethod = "GET")
@PostMapping("/profile")
public ApiResult profile(@RequestBody SysUserVo sysUserVo) {
Boolean result = false;
String imageRelativePath = "static/upload";
String imageBase64Str;
Integer userId = UserUtil.getUserId(request);
//如果相同
if (userId > 0) {
//保存头像
StringBuffer fileName = new StringBuffer();
fileName.append(UUID.randomUUID().toString().replaceAll("-", ""));
if (StringUtils.isBlank(sysUserVo.getAvatar())) {
return new ApiResult<>(false);
} else if (sysUserVo.getAvatar().indexOf("data:image/png;") != -1) {
imageBase64Str = sysUserVo.getAvatar().replace("data:image/png;base