Merge branch 'wx-dev' of https://github.com/rymcu/forest into wx-dev
This commit is contained in:
commit
2214623844
@ -128,7 +128,7 @@ public class UploadController {
|
|||||||
data.put("message", "上传失败!");
|
data.put("message", "上传失败!");
|
||||||
return GlobalResultGenerator.genSuccessResult(data);
|
return GlobalResultGenerator.genSuccessResult(data);
|
||||||
}
|
}
|
||||||
String md5 = DigestUtils.md5DigestAsHex(multipartFile.getInputStream());
|
String md5 = DigestUtils.md5DigestAsHex(multipartFile.getBytes());
|
||||||
String orgName = multipartFile.getOriginalFilename();
|
String orgName = multipartFile.getOriginalFilename();
|
||||||
String fileType = FileUtils.getExtend(orgName);
|
String fileType = FileUtils.getExtend(orgName);
|
||||||
String fileUrl = forestFileService.getFileUrlByMd5(md5, tokenUser.getIdUser(), fileType);
|
String fileUrl = forestFileService.getFileUrlByMd5(md5, tokenUser.getIdUser(), fileType);
|
||||||
@ -190,8 +190,8 @@ public class UploadController {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
String fileType = FileUtils.getExtend(orgName);
|
String fileType = FileUtils.getExtend(orgName);
|
||||||
try (InputStream in = multipartFile.getInputStream()) {
|
try {
|
||||||
String md5 = DigestUtils.md5DigestAsHex(in);
|
String md5 = DigestUtils.md5DigestAsHex(multipartFile.getBytes());
|
||||||
String fileUrl = forestFileService.getFileUrlByMd5(md5, tokenUser.getIdUser(), fileType);
|
String fileUrl = forestFileService.getFileUrlByMd5(md5, tokenUser.getIdUser(), fileType);
|
||||||
if (StringUtils.isNotEmpty(fileUrl)) {
|
if (StringUtils.isNotEmpty(fileUrl)) {
|
||||||
successMap.put(orgName, fileUrl);
|
successMap.put(orgName, fileUrl);
|
||||||
@ -281,7 +281,7 @@ public class UploadController {
|
|||||||
return GlobalResultGenerator.genSuccessResult(data);
|
return GlobalResultGenerator.genSuccessResult(data);
|
||||||
}
|
}
|
||||||
// 获取文件md5值
|
// 获取文件md5值
|
||||||
String md5 = DigestUtils.md5DigestAsHex(inputStream);
|
String md5 = DigestUtils.md5DigestAsHex(getData);
|
||||||
String fileType = "." + MimeTypeUtils.parseMimeType(conn.getContentType()).getSubtype();
|
String fileType = "." + MimeTypeUtils.parseMimeType(conn.getContentType()).getSubtype();
|
||||||
String fileUrl = forestFileService.getFileUrlByMd5(md5, tokenUser.getIdUser(), fileType);
|
String fileUrl = forestFileService.getFileUrlByMd5(md5, tokenUser.getIdUser(), fileType);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user