更新了写真预约特殊产品处理
This commit is contained in:
parent
0e5bc9d778
commit
df3aa4c46f
|
@ -121,15 +121,10 @@ public class FileController {
|
||||||
//
|
//
|
||||||
// 校验文件
|
// 校验文件
|
||||||
validFile(multipartFile, null);
|
validFile(multipartFile, null);
|
||||||
// 校验用户是否登录
|
|
||||||
User loginUser = userService.getLoginUser(request);
|
|
||||||
if (loginUser == null) {
|
|
||||||
throw new BusinessException(ErrorCode.NOT_LOGIN_ERROR, "未登录");
|
|
||||||
}
|
|
||||||
// 文件目录:根据业务、用户来划分
|
// 文件目录:根据业务、用户来划分
|
||||||
String uuid = RandomStringUtils.randomAlphabetic(8);
|
String uuid = RandomStringUtils.randomAlphabetic(8);
|
||||||
String filename = uuid + "-" + multipartFile.getOriginalFilename();
|
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);
|
File file = new File(FileConstant.SERVER_UPLOAD_DIR, filepath);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user