头像显示问题

This commit is contained in:
hzj
2024-09-24 15:32:38 +08:00
parent 3280c29013
commit dcfcf3ece2

View File

@@ -207,7 +207,7 @@ public class FileStorageUtil {
} catch (Exception exception) {
throw new BusinessException(OssResponseEnum.DOWNLOAD_FILE_STREAM_ERROR);
}
String fileType = filePath.substring(filePath.lastIndexOf('.')).toLowerCase();
String fileType = filePath.substring(filePath.lastIndexOf('.')+1).toLowerCase();
switch (fileType) {
case "jpg":
case "jpeg":
@@ -221,7 +221,7 @@ public class FileStorageUtil {
break;
default:
response.setContentType("application/octet-stream;charset=UTF-8");
response.setHeader("Content-Disposition", "inline;attachment;filename=" + filePath);
response.setHeader("Content-Disposition", "attachment;filename=" + filePath);
break;
}
try {