diff --git a/backend/wall-server/src/main/java/cn/yiming1234/NottinghamWall/service/impl/StudentServiceImpl.java b/backend/wall-server/src/main/java/cn/yiming1234/NottinghamWall/service/impl/StudentServiceImpl.java index 734327a2..77ed2bbc 100644 --- a/backend/wall-server/src/main/java/cn/yiming1234/NottinghamWall/service/impl/StudentServiceImpl.java +++ b/backend/wall-server/src/main/java/cn/yiming1234/NottinghamWall/service/impl/StudentServiceImpl.java @@ -301,7 +301,8 @@ public Student update(StudentDTO studentDTO) throws Exception { } String currentAvatarName = student.getAvatar(); - String newAvatarName = studentDTO.getAvatar(); + String newAvatarName = extractFileName(studentDTO.getAvatar()); + log.info(newAvatarName); if (!currentAvatarName.equals(newAvatarName) && !student.getAvatar().contains("default.jpg")) { aliOssUtil.delete(currentAvatarName); }