提交 0145b5ab authored 作者: YunaiV's avatar YunaiV

修复头像上传不支持 PUT 类型的方法

上级 0930c1ff
...@@ -96,7 +96,7 @@ public class UserProfileController { ...@@ -96,7 +96,7 @@ public class UserProfileController {
return success(true); return success(true);
} }
@PostMapping("/update-avatar") @RequestMapping(value = "/update-avatar", method = {RequestMethod.POST, RequestMethod.PUT}) // 解决 uni-app 不支持 Put 上传文件的问题
@Operation(summary = "上传用户个人头像") @Operation(summary = "上传用户个人头像")
public CommonResult<String> updateUserAvatar(@RequestParam("avatarFile") MultipartFile file) throws Exception { public CommonResult<String> updateUserAvatar(@RequestParam("avatarFile") MultipartFile file) throws Exception {
if (file.isEmpty()) { if (file.isEmpty()) {
...@@ -106,4 +106,4 @@ public class UserProfileController { ...@@ -106,4 +106,4 @@ public class UserProfileController {
return success(avatar); return success(avatar);
} }
} }
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论