删除无用代码
This commit is contained in:
-4
@@ -29,10 +29,6 @@ public abstract class AbstractIFileService extends ServiceImpl<FileMapper, FileI
|
|||||||
@Override
|
@Override
|
||||||
public FileInfo upload(MultipartFile file) throws Exception {
|
public FileInfo upload(MultipartFile file) throws Exception {
|
||||||
FileInfo fileInfo = FileUtil.getFileInfo(file);
|
FileInfo fileInfo = FileUtil.getFileInfo(file);
|
||||||
FileInfo oldFileInfo = baseMapper.selectById(fileInfo.getId());
|
|
||||||
if (oldFileInfo != null) {
|
|
||||||
return oldFileInfo;
|
|
||||||
}
|
|
||||||
if (!fileInfo.getName().contains(FILE_SPLIT)) {
|
if (!fileInfo.getName().contains(FILE_SPLIT)) {
|
||||||
throw new IllegalArgumentException("缺少后缀名");
|
throw new IllegalArgumentException("缺少后缀名");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,10 +22,8 @@ public class FileUtil {
|
|||||||
throw new IllegalStateException("Utility class");
|
throw new IllegalStateException("Utility class");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static FileInfo getFileInfo(MultipartFile file) throws Exception {
|
public static FileInfo getFileInfo(MultipartFile file) {
|
||||||
//String md5 = fileMd5(file.getInputStream());
|
|
||||||
FileInfo fileInfo = new FileInfo();
|
FileInfo fileInfo = new FileInfo();
|
||||||
// 将文件的md5设置为文件表的id
|
|
||||||
fileInfo.setId(IdUtil.fastSimpleUUID());
|
fileInfo.setId(IdUtil.fastSimpleUUID());
|
||||||
fileInfo.setName(file.getOriginalFilename());
|
fileInfo.setName(file.getOriginalFilename());
|
||||||
fileInfo.setContentType(file.getContentType());
|
fileInfo.setContentType(file.getContentType());
|
||||||
|
|||||||
@@ -98,7 +98,6 @@ zlt:
|
|||||||
/api-uaa/css/**,
|
/api-uaa/css/**,
|
||||||
/api-uaa/images/**,
|
/api-uaa/images/**,
|
||||||
/api-uaa/js/**,
|
/api-uaa/js/**,
|
||||||
/api-user/users-anon/**,
|
|
||||||
/login.html,
|
/login.html,
|
||||||
/user/login
|
/user/login
|
||||||
auth:
|
auth:
|
||||||
|
|||||||
Reference in New Issue
Block a user