更改文件名
This commit is contained in:
@ -96,7 +96,7 @@ public class FaceController {
|
|||||||
uploadDir.mkdir();
|
uploadDir.mkdir();
|
||||||
}
|
}
|
||||||
String suffix = FileNameUtil.getSuffix(file.getOriginalFilename());
|
String suffix = FileNameUtil.getSuffix(file.getOriginalFilename());
|
||||||
String imagePath = uploadDirPath + userId + "." + suffix;
|
String imagePath = uploadDirPath + IdUtil.getSnowflakeNextIdStr() + "." + suffix;
|
||||||
// 获取文件字节并保存到指定路径
|
// 获取文件字节并保存到指定路径
|
||||||
byte[] bytes = file.getBytes();
|
byte[] bytes = file.getBytes();
|
||||||
Path path = Paths.get(imagePath);
|
Path path = Paths.get(imagePath);
|
||||||
|
Reference in New Issue
Block a user