mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-02-22 17:31:15 +08:00
Implement real async COS image upload
This commit is contained in:
@@ -29,7 +29,7 @@ public class UserController {
|
||||
@PostMapping("/me/avatar")
|
||||
public ResponseEntity<?> uploadAvatar(@RequestParam("file") MultipartFile file,
|
||||
Authentication auth) throws IOException {
|
||||
String url = imageUploader.upload(file.getBytes(), file.getOriginalFilename());
|
||||
String url = imageUploader.upload(file.getBytes(), file.getOriginalFilename()).join();
|
||||
userService.updateAvatar(auth.getName(), url);
|
||||
return ResponseEntity.ok(Map.of("url", url));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user