头像上传成功后返回图片key

master
toesbieya 6 years ago
parent e60890c9b9
commit 04f2c29b48
  1. 3
      java/cloud/web/web-modules/account/src/main/java/cn/toesbieya/jxc/account/controller/AccountController.java
  2. 2
      java/cloud/web/web-modules/account/src/main/java/cn/toesbieya/jxc/account/service/AccountService.java
  3. 3
      java/local/src/main/java/cn/toesbieya/jxc/controller/AccountController.java
  4. 2
      java/local/src/main/java/cn/toesbieya/jxc/service/AccountService.java

@ -55,8 +55,7 @@ public class AccountController {
public R updateAvatar(@RequestParam String key) throws UnsupportedEncodingException {
if (StringUtils.isEmpty(key)) return R.fail("参数错误");
UserVo user = SessionUtil.get();
return service.updateAvatar(user, URLDecoder.decode(key, "utf-8"));
return service.updateAvatar(SessionUtil.get(), URLDecoder.decode(key, "utf-8"));
}
@GetMapping("validate")

@ -215,7 +215,7 @@ public class AccountService {
}
user.setAvatar(avatar);
SessionUtil.save(user);
return R.success("上传头像成功");
return R.success("上传头像成功", avatar);
}
//否则删除此次上传至云的头像

@ -54,8 +54,7 @@ public class AccountController {
public R updateAvatar(@RequestParam String key) throws UnsupportedEncodingException {
if (StringUtils.isEmpty(key)) return R.fail("参数错误");
UserVo user = SessionUtil.get();
return service.updateAvatar(user, URLDecoder.decode(key, "utf-8"));
return service.updateAvatar(SessionUtil.get(), URLDecoder.decode(key, "utf-8"));
}
@GetMapping("validate")

@ -204,7 +204,7 @@ public class AccountService {
}
user.setAvatar(avatar);
SessionUtil.save(user);
return R.success("上传头像成功");
return R.success("上传头像成功", avatar);
}
//否则删除此次上传至云的头像

Loading…
Cancel
Save