更新了写真预约特殊产品处理

This commit is contained in:
chen-xin-zhi 2025-03-05 19:38:06 +08:00
parent 0e5bc9d778
commit df3aa4c46f

View File

@ -121,15 +121,10 @@ public class FileController {
//
// 校验文件
validFile(multipartFile, null);
// 校验用户是否登录
User loginUser = userService.getLoginUser(request);
if (loginUser == null) {
throw new BusinessException(ErrorCode.NOT_LOGIN_ERROR, "未登录");
}
// 文件目录根据业务用户来划分
String uuid = RandomStringUtils.randomAlphabetic(8);
String filename = uuid + "-" + multipartFile.getOriginalFilename();
String filepath = String.format("/%s/%s/%s", "single", loginUser.getId(), filename);
String filepath = String.format("/%s/%s/%s", "single", "yt", filename);
// 判断目录是否存在
File file = new File(FileConstant.SERVER_UPLOAD_DIR, filepath);