fix avatar pc

This commit is contained in:
Chuck1sn
2025-06-15 16:38:39 +08:00
parent dc7780e0a8
commit d9853ef8d0
5 changed files with 21 additions and 5 deletions

View File

@@ -48,7 +48,7 @@ public class IdentityAccessController {
produces = MediaType.TEXT_PLAIN_VALUE)
public String uploadAvatar(Principal principal, @RequestPart("file") MultipartFile multipartFile)
throws Exception {
String objectName = String.format("avatar/%s/avatar.jpg", principal.getName());
String objectName = String.format("/avatar/%s/avatar.jpg", principal.getName());
if (multipartFile.isEmpty()) {
throw new BusinessException("上传的文件不能为空");
}